-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:Mac OS X
I have this collection
> db.alunos.find({},
)
{"_id" : ObjectId( "4b7c3d34ca4fb4692dd91c5b") , "idade" : 9 , "armario" : ["Sandwich de presunto","Foto da Popis"]} {"_id" : ObjectId( "4b7c3d19ca4fb4692dd91c59") , "idade" : 8 , "armario" : ["Boneca de pano"]} {"_id" : ObjectId( "4b7c3d2dca4fb4692dd91c5a") , "idade" : 9}I try to aggregate like this
> db.alunos.group({
key:
,
initial:
,
reduce: function(aluno, grupo) {
if (aluno.armario) {
aluno.armario.forEach(function(objeto)
)
}
},
finalize: function(out) {}
})
[
,
{"idade" : 8 , "armario" : ["Sandwich de presunto","Foto da Popis","Boneca de pano"]}]
Notice that it is aggregating all objects in all keys. That shouldn`t be happening.