-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 8.0.24
-
Component/s: None
-
None
-
Query Execution
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Enterprise dstCluster-rs [primary] test> db.aggregate([{$documents: [{$literal: {"$set": 123}}]}, {"$_internalApplyOplogUpdate":{"oplogUpdate":{"$v":2,"diff":{"u":{"$set":{"name":"yyy"}}}}}}])
MongoServerError[DollarPrefixedFieldName]: PlanExecutor error during aggregation :: caused by :: The dollar ($) prefixed field '$set' in '$set' is not allowed in the context of an update's replacement document. Consider using an aggregation pipeline with $replaceWith.
The intent—admittedly contrived—of the update is to set the value of the field “\$set” to {name:"yyy"}.
This works in 8.0.21 but breaks in 8.0.24.
To generate this sequence in the oplog:
db.foo.insert({_id: 1, str: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})
db.foo.updateOne({_id: 1}, [{$replaceWith: {$setField: {field: {$literal:"$set"}, input: "$$ROOT", value: { name: "yyy" } }}}])
- is related to
-
SERVER-123633 Fix handling of user $-prefixed fields colliding with internal metadata
-
- Closed
-