|
Issue no longer reproes:
./build/opt/install/bin/mongod --dbpath ~/dbpath --logpath ~/dbpath/mongod.log --vvvvv --fork
|
./build/opt/install/bin/mongo
|
MongoDB Enterprise > db.sales.insert({_id: 5, item: "foo", quantity: {a:5}})
WriteResult({ "nInserted" : 1 })
MongoDB Enterprise > db.sales.insert({_id: 6, item: "foo", quantity: {a:6}})
WriteResult({ "nInserted" : 1 })
MongoDB Enterprise > db.sales.aggregate([\{$group: {_id: "$item", mergedSales: {$mergeObjects: "$quantity"}}}])
{ "_id" : "foo", "mergedSales" :
{ "a" : 6 }
}
From dbpath/mongod.log
[2] mkbson s10 [_id = s7, mergedSales = s9] true false
[2] group [s7] [s9 = mergeObjects (s8)]
[2] filter {let [l1.0 = s8] ! exists (l1.0) || typeMatch (l1.0, 0x00000440) || isObject (l1.0) || fail ( 5911200 , only supports objects)}
[2] project [s8 = getField (s4, "quantity")]
[2] project [s7 = fillEmpty (s6, null)]
[2] project [s6 = getField (s4, "item")]
[1] scan s4 s5 none none none none [] @"f2f8ea7b-abfd-42cf-a78a-bdda76ebcc24" true false
The plan looks correct.
|