Is there a way to omit adding/updating document if it was found in the collection without doing two requests to Mongo server? It would be perfect if this can be done in bulk, but I would appreciate to hear other options or workarounds.
What I'm looking for is sort of opposite of upsert option:
var bulk = MyCollection.initializeUnorderedBulkOp();
bulk.find({ x: val }).upsertOnlyIfNotFound({ x: newVal });
bulk.execute();