Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-22218

Push opeartion failed if push and upsert for same document were built into same BulkOperation execution

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Environment:
      MongoDB 3.0.5
      C++ driver: 1.0.1
      OS: centos 7
    • Linux
    • Hide

      BulkOperationBuilder p_builder
      p_builder.find(queryObj).upsert().updateOne(BSON("$set"<<bsonObj_1));
      p_builder.find(queryObj).update(BSON("$push"<<bsonObj_2));

      p_builder.execute()

      If both query hit same document, the push operation didn't create the array correctly.

      If move push operation away from bulkOperationBuilder and run it in the non-bulk mode, the array field was created correctly.
      Moreover, even push operation failed in the bulkOpeation mode, there is no exception raised for the bulkOperation.execute().

      Show
      BulkOperationBuilder p_builder p_builder.find(queryObj).upsert().updateOne(BSON("$set"<<bsonObj_1)); p_builder.find(queryObj).update(BSON("$push"<<bsonObj_2)); p_builder.execute() If both query hit same document, the push operation didn't create the array correctly. If move push operation away from bulkOperationBuilder and run it in the non-bulk mode, the array field was created correctly. Moreover, even push operation failed in the bulkOpeation mode, there is no exception raised for the bulkOperation.execute().

      Two separated opeartion: push and upsert were built in same BulkOperation.
      if two operation will operate on same document, it will cause the push operation failed.

            Assignee:
            wan.bachtiar@mongodb.com Wan Bachtiar
            Reporter:
            gabriel.wang gabriel.wang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: