-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
Description
The Backwards Incompatible Features section in 3.6 should include the Update Operation Changes.
In the example below, you can see that setting FCV to 3.6 impacts the way data is stored when adding new fields to a document via an update statement.
> db.coll.drop() true > db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } ) { "ok" : 1 } > db.coll.insert({ _id: 0, x: 0 }) WriteResult({ "nInserted" : 1 }) > db.coll.update({_id: 0}, {$set: {b: 0, a: 0}}) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) > db.coll.find() { "_id" : 0, "x" : 0, "b" : 0, "a" : 0 }
Note: when FCV is set to 3.4, fields are added in the order they were presented
> db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } ) { "ok" : 1 } > db.coll.update({_id: 0}, {$set: {d: 0, c: 0}}) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) > db.coll.find() { "_id" : 0, "x" : 0, "b" : 0, "a" : 0, "c" : 0, "d" : 0 }
Note: when FCV is set to 3.6, fields are added in lexicographic order