PyMongo 3.0 no longer returns _id when doing a replace in Collection.save()

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 3.0.1
    • Affects Version/s: 3.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There one huge behaviour change in PyMongo 3, which is not documented if at all wished, but in my opinion is a bug (and therefore this ticket).

      In collection.py, in the save() method, we had in PyMongo 2.X:

      self.update({"_id": to_save["_id"]}, to_save, True, manipulate, safe, check_keys=check_keys, **kwargs)
              return to_save.get("_id", None)
      

      And now in PyMongo 3.0:

      self._update(sock_info, {"_id": to_save["_id"]}, to_save, True, check_keys, False, manipulate, write_concern)
      

      With no return !!! Whereas many apps base on the fact to check for the id to now if the upsert really worked.

              Assignee:
              Bernie Hackett
              Reporter:
              Matthieu Rigal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: