MongoDocumentStore constructs a malformed query for bulk update of new documents. The query is:
while it actually should be:
It doesn't seem to do any harm in a non-sharded deployment. The query does not mistakenly match documents.
However there is a problem when MongoDB is shareded and the calls are routed through mongos. The bulk update become very slow (more than a factor of 10). I assume mongos cannot figure out where to route the bulk update and resorts to executing the updates individually.