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

$unwind does not work when there is an array inside an object. i.e { $unwind: "$a.sizes" } #80

Closed
felipecarrillo100 opened this issue Apr 16, 2018 · 0 comments
Labels

Comments

@felipecarrillo100
Copy link

$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" } ] )
@felipecarrillo100 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
@kofrasa kofrasa added the bug label Apr 17, 2018
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

2 participants