You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$unwind does not work when the array is inside an object. For instance if the array is inside object a, as in the example below:
var data = [
{ "_id" : 1, "item" : "ABC", "a":{"sizes": [ "S", "M", "L"] }},
{ "_id" : 2, "item" : "EFG", "a":{"sizes" : [ ] }},
{ "_id" : 3, "item" : "IJK", "a":{"sizes": "M"} },
{ "_id" : 4, "item" : "LMN", "a":{}},
{ "_id" : 5, "item" : "XYZ", "a":{"sizes" : null} }
]
var a = mingo.aggregate(data, [ { $unwind: "$a.sizes" } ] )
The text was updated successfully, but these errors were encountered:
felipecarrillo100
changed the title
$unwind does not work when there is an element inside an object. i.e { $unwind: "$a.sizes" }
$unwind does not work when there is an array inside an object. i.e { $unwind: "$a.sizes" }
Apr 16, 2018
$unwind does not work when the array is inside an object. For instance if the array is inside object a, as in the example below:
var data = [
{ "_id" : 1, "item" : "ABC", "a":{"sizes": [ "S", "M", "L"] }},
{ "_id" : 2, "item" : "EFG", "a":{"sizes" : [ ] }},
{ "_id" : 3, "item" : "IJK", "a":{"sizes": "M"} },
{ "_id" : 4, "item" : "LMN", "a":{}},
{ "_id" : 5, "item" : "XYZ", "a":{"sizes" : null} }
]
The text was updated successfully, but these errors were encountered: