Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-473

mongoc_collection_update() should provide access to WriteResult

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.0.2
    • None
    • None
    • Minor Change

    Description

      There does not appear to be a way to determine whether a mongoc_collection_update failed to locate any documents that satisfy the query. I would expect this is an error condition in many applications (in my case it revealed a thread race issue).

      I have found 2 work arounds. One is to put the update into a bulk operation and look at the reply from mongoc_bulk_operation_execute(). The other is to use mongoc_collection_find_and_modify() and request at least one field return. Any comment on which is more efficient?

      Attachments

        Activity

          People

            Unassigned Unassigned
            timful Tim Dorcey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: