Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
ALL
Description
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
|
}
|
Attachments
Issue Links
- is duplicated by
-
SERVER-6259 Can't $project into _id
-
- Closed
-