How can i do a optimistic update with this driver?
By an optimistic update I mean something like this:
def update_email(cb, user_id, email):
while True:
result = cb.get(user_id)
user_doc = result.value
user_doc['email'] = email
cb.upsert(user_id, user_doc, cas=result.cas)
break # Mutation succeeded
except KeyExistsError:
# This means the CAS has been modified. We still need to
# insert the email field, but do not want to override new changes
continue
How can i do a optimistic update with this driver?
By an optimistic update I mean something like this:
Has can be found on couchbase documentation, here: https://developer.couchbase.com/documentation/server/4.5/sdk/concurrent-mutations-cluster.html
Best regards, nice library.