I have documents like this:
{
id:1,
"A": [
{
"C": "abc",
"D": [{X:"test"},{X:"test2"}]
},
{
"C": "fg",
"D":["X1"]
}
]
}
How to get all id of document whose tag match A-> D -> X has value "test". I can use concatMap()
but when I use it I am not able get "id" field and also cannot use it inside map
, is there any similar features like $unwind
of Mongodb
's aggregation framework?
Similar to :Querying array of nested objects
[Original Question]
{
id:2,
tags[{a:3,b:4},..]
}