You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is no way to update (overwrite) entire object by query which is very useful for optimistic locking and already provided by mongo java driver. There are two possibilities:
Get user a way to create Update from domain object
Add new method(s) to MongoOperations like update(Query, Object) - not sure how it will fit into existing update(Query, Update) scheme.
Currently i'm forced to use code like
DBObject object = new BasicDBObject();
mongoTemplate.getConverter().write(project, object);
DBCollection collection = mongoTemplate.getCollection("myCollection");
WriteResult result = collection.update(query, object, WriteConcern.SAFE);