1

Using Ming and PyMongo I have created several documents with more than one unique index. If a DuplicateKeyError is thrown, then I want to query for the conflicting document. Is there a way for me to take a DuplicateKeyError exception and know what field (or combination of fields) generated the exception?

This is not a duplicate because the error document is not always returned with .details (The 2.8 version of .error_document). Its my understanding it might be included. There is no guarantee. In my case .details is returning None when the duplicate key is thrown.

K Engle
  • 1,322
  • 2
  • 11
  • 23

0 Answers0