Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB query error #662

Closed
varadig opened this issue Aug 30, 2017 · 13 comments
Closed

MongoDB query error #662

varadig opened this issue Aug 30, 2017 · 13 comments

Comments

@varadig
Copy link

varadig commented Aug 30, 2017

When I wanted to create query like this:

var condition:Dynamic = {"_id" : update.foundationID,"events" : {"$elemMatch":update.eventID}};

but the editos say to me:
screen shot 2017-08-30 at 13 09 35

If I use in this way, the editor dont show me error:

var condition:Dynamic = {_id : update.foundationID, events : {}};
Reflect.setField(condition.events, "$elemMatch", {_id:update.eventID});

But in this way, I cant create complex query with operators

If I compile with haxe in cli, everything is oke.

@EricBishton
Copy link
Member

@varadig Are there follow-on errors (e.g. the rest of the file is unrecognized), or is the issue localized to that statement?

@varadig
Copy link
Author

varadig commented Aug 30, 2017

@EricBishton after this statement, rest of the file is unrecognized. Tomorrow I will include screenshoot with more detail.

@varadig
Copy link
Author

varadig commented Aug 31, 2017

screen shot 2017-08-31 at 12 01 47

@varadig
Copy link
Author

varadig commented Sep 26, 2017

Any update for this issue?

@mayakwd
Copy link
Contributor

mayakwd commented Sep 26, 2017

Not yet, looking for workaround

@EricBishton
Copy link
Member

@mayakwd I think that

objectLiteralElement ::= (identifier | OPEN_QUOTE REGULAR_STRING_PART CLOSING_QUOTE) ':' expression {recoverWhile="object_literal_part_recover"}

should become

objectLiteralElement ::= (identifier | OPEN_QUOTE REGULAR_STRING_PART CLOSING_QUOTE) ':' (expression | objectLiteral) {recoverWhile="object_literal_part_recover"}
                                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@mayakwd
Copy link
Contributor

mayakwd commented Sep 26, 2017

@EricBishton tried that already, won't help :-(

@EricBishton
Copy link
Member

According to @mayakwd, the problem is (also??) with the identifier portion. So, perhaps:

objectLiteralElement ::= (identifier | stringLiteralExpression) ':' (expression | objectLiteral) {recoverWhile="object_literal_part_recover"}
                                       ^^^^^^^^^^^^^^^^^^^^^^^       ^^^^^^^^^^^^^^^^^^^^^^^^^^^

@varadig
Copy link
Author

varadig commented Nov 21, 2017

theres no hope to fix this issue? I realy need to use complex query but I cant with IntelliJ.

@mayakwd
Copy link
Contributor

mayakwd commented Nov 21, 2017

@varadig. i'll dig into it tomorrow

@varadig
Copy link
Author

varadig commented Nov 21, 2017

@mayakwd, thank you very much!

@EricBishton
Copy link
Member

I've fixed it on my personal work repo. I'll make a PR once it builds and tests cleanly.

@varadig
Copy link
Author

varadig commented Nov 23, 2017

I will test asap! Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants