Skip to content

Instantly share code, notes, and snippets.

@neumino
Created January 13, 2014 05:37
Show Gist options
  • Save neumino/8395229 to your computer and use it in GitHub Desktop.
Save neumino/8395229 to your computer and use it in GitHub Desktop.
CAS
r.table("test").get("idValue").update(function(doc) {
return r.branch(
doc("lastUpdate").eq(newDoc["lastUpdate"]),
newDoc.merge({lastUpdate: r.now()}),
r.error("Wrong version")
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment