Two separated operation: $push and $upsert were built in same BulkOperation. if two operations perform on different field of same document, it will cause the $push operation failed.
This issue occurs only when very heavy writing operation on a collection, and about 1/1000 $push operation failed, and the majority $push operation is correct.
BulkOperationBuilder p_bulk = db_conn_.initializeOrderedBulkOp(db_collection_ns_);
p_builder.find(queryObj).upsert().updateOne(BSON("$set"<<bsonObj_1));
p_builder.find(queryObj).update(BSON("$push"<<bsonObj_2));
try
{
p_builder.execute()
}
catch(const DBException& eobj)
{
..........
}
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().
[Environment]
1) mongo-cxx-driver legacy v1.0.1
2) Mongodb 3.0.5 + wiredTiger
3) CentOS 7
4) In terms of the order of $push and $set for a given document, the $push is the final operation on a given document. It's impossible that a $push happen before a $set for a specific document.
Thanks for your help in advance.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/a0321678-a040-40fb-9c37-a94a8a05052d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.