Steve,
I'll add a ticket on Jira this evening.
In the meantime, I'd like to share a bit more what I'd like to do. :)
I need to implement "optimistic concurrency". So my steps are:
- read object from DB
- create a copy
- modify values
- update db using both object and original object
- I'll get true or false
Actually my code is:
Person p = personColl.FindOne(...);
Person p_original = p.SimpleClone();
p.Name = "new_name";
bool result = personColl.UpdateOptimicticConcurrency(p, p_original);
public static bool UpdateOptimicticConcurrency<T>(this IMongoCollection<T> collection, T newObject, T oldObject) where T : class
{
collection.Update(newObject, oldObject);
Document error = collection.Database.GetLastError();
return (bool)error["updatedExisting"];
}