-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Observed behavior: Projecting to the _id field causes two _id fields to be written to the result document, both of which have source _id value not the computed _id value.
Expected behavior: The result document's _id is computed based on the projection spec.
Test:
c = db.c;
c.drop();
c.save( { a:1 } );
printjson( c.aggregate( { $project:{ _id:'$a' } } ) );
Result:
{
"result" : [
{
"_id" : ObjectId("4fe4ef9ed233d4cbc75b1246"),
"_id" : ObjectId("4fe4ef9ed233d4cbc75b1246")
}
],
"ok" : 1
}
- is duplicated by
-
SERVER-6259 Can't $project into _id
-
- Closed
-