If my collection has WriteConcern.SAFE, shouldn't trying to update( upsert=FALSE) a non-existent record throw an exception? This isn't happening in my application.
Here's a contrived example that exhibits the behavior:
DBCollection collection = getDb().getCollection("empty_collection");
collection.setWriteConcern( WriteConcern.SAFE);
collection.update( new BasicDBObject().append("_id", "doesntExist"), new BasicDBObject().append("some", "value"), false, false);
No exception is thrown here. If this is by design, how should I test for attempts to update non-existent records?