Query for getting all the values for nested array #4974
Unanswered
roshan21097
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
{ "store": { "bicycle": [ { "category": "reference", "price": 9.99 }, { "category": "fiction", "price": 12.99 } ] } }
Here we want to fetch the all the "price"
Able to get at a particular index using this query
{ "selector": { "_id": { "$gt": "0" } }, "fields": [ "store.bicycle.0.price" ] }
but I want all the 'price' just like in some queries, where we can use '[*]' for getting all the values. Can someone tell me whether it is possible or not, if possible then how we can get all the 'prices' present in a nested array?
Beta Was this translation helpful? Give feedback.
All reactions