Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-697

v 2.7 breaks backward compatibility on results returned by update with upsert

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.7.1, 3.0
    • Affects Version/s: 2.7
    • Component/s: None
    • None
    • Environment:
      not sharded not replicated mongodb v 2.6.1, running on debian
    • Minor Change

      MongoClient.db.col.update({'_id':'A'}, {'$set':{'foo':'bar'}}, upsert=True)
      

      v 2.7 returns:

      {'updatedExisting': False, u'nModified': 0, u'ok': 1, u'upserted': [{u'index': 0, u'_id': u'a'}], u'n': 1}
      

      pre 2.7 returns:

      {u'syncMillis': 0, u'ok': 1.0, u'err': None, u'upserted': u'a', u'writtenTo': None, u'connectionId': 124, u'n': 1, u'updatedExisting': False}
      

      Notice the 'upserted' used to be just the _id while now it is a list

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            nickmilon Nick Milonakis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: