Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12163

Update Operation Changes should be included in the features impacted by FCV

      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

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            Unassigned Unassigned
            Reporter:
            arnie.listhaus@mongodb.com Arnie Listhaus
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              1 year, 25 weeks ago