Open
Description
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.