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

Bulk write updates require $set, but regular updates do not

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

      mongoc_bulk_operation_update (bulk, BCON_NEW ("a", BCON_INT32 (1)), BCON_NEW ("a", BCON_INT32 (2)), false);
      
      mongoc_bulk_operation_execute (bulk, &reply, &error);
      

      produces the error

      WARNING:       mongoc: mongoc_bulk_operation_update(): update only works with $ operators.
      Error: Cannot do an empty bulk write
      

      However, mongoc_collection_update allows updating without $set.

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: