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

duplicate key insert to capped collection with unique index generates OperationFailure instead of DuplicateKeyError

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.10
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      If you try to insert a document with safe=True, which violates a key uniqueness constraint, instead of raising a proper DuplicateKeyError, pymongo raises an OperationFailure exception with the following args:

      (u'duplicate key insert for unique index of capped collection',)

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            metheus Avery Rosen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: