InsertOneAsync doesn't throw MongoDuplicateKeyException

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Critical - P2
    • None
    • Affects Version/s: 2.2
    • Component/s: Error Handling
    • None
    • Environment:
      Windows
    • None
    • Minor Change
    • None
    • None
    • None
    • None
    • None
    • None

      When calling InsertOneAsync with a duplicate key, you get a MongoWriteException. By digging into the WriteError and looking at the code you can determine what the actual failure is, but this behavior is different from something like ReplaceOneAsync which thrown a DuplicateKeyException.

              Assignee:
              Unassigned
              Reporter:
              Benjamin Randall
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: