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

wrong resolution of deep query if selector matches the field too and order in query is unfortunate #7

Open
Jamesgt opened this issue Dec 13, 2017 · 0 comments
Labels

Comments

@Jamesgt
Copy link
Contributor

Jamesgt commented Dec 13, 2017

If you have a reference to an other type, eg: User and you query:
{ "?boss": { "?.*": "" }, "?.*": "" }
then in the result you get:
{ "boss": 15, "name": "John Doe" }

but if you do this way:
{ "?.*": "", "?boss": { "?.*": "" } }
you get:
{ "boss": { "name": "Jane Doe" }, "name": "John Doe" }

The problem is that in the outer object key enumeration, the .* selector matches also the reference type and simply overwrites the already found deep value with the reference number.

Possible solution is to mark the keys that are already added to the result.

Workaround until it is fixed: as you see above, sort the field queries, so the less specific should be at the beginning.

@Jamesgt Jamesgt added the bug label Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant