|
This is a continuation to SERVER-75517 where the changes from 819f9d1 made it so the server checks the top-level fields within an _id embedded object do not start with a '$' character. The non top-level fields in the _id embedded object won't be validated for '$' characters by an update using upsert=true. The upsert behavior diverges from the storage_validation::storageValidIdField() / BSONObj::storageValidEmbedded() behavior called by the insert command via fixDocumentForInsert() in which the latter recursive checks that fields in embedded objects and arrays at any level do not start with a '$' character.
This difference in behavior between [updates using upsert=true] and inserts would prevent tools like mongosync which perform a logical sync from successfully copying over the documents. Probably the documents should be prevented from being upserted to preserve the pre PM-1856 behavior for the _id field.
|