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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 2.7
    • 2.7.1, 3.0
    • None
    • None
    • not sharded not replicated mongodb v 2.6.1, running on debian
    • Minor Change

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: