-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
-
ALL
We see that the new field, which should equal the recordId, is not added to the output:
> db.newcoll.insert({a: 1}) WriteResult({ "nInserted" : 1 }) > db.newcoll.aggregate([{$addFields: {rid: {$meta: "recordId"}}}]) { "_id" : ObjectId("65c281f44bb7df438ffb4d1e"), "a" : 1 }
However this works with $project instead:
db.newcoll.aggregate([{$project:{rid: {$meta: "recordId"}} }]) { "_id" : ObjectId("65c289a24bb7df438ffb4d2a"), "rid" : NumberLong(6) }
See comments for more info.
- is related to
-
SERVER-86296 Existing $recordId field hidden when showRecordId:true is used
- Closed