awesome, thanks!
r.table('foo')
.get(5)
.update({
'_rev': r.branch(r['_rev'] == 5,
r('_rev').add(1),
r.error("invalid revision")
),
'name': "awesome name"
})
the basic idea is that `name` should be update to "awesome name" and `_rev` should be incremented by 1, but only if `_rev` is 5, otherwise an "invalid revision" error should be thrown. r.table('foo').get(5).update({ 'bar': r.branch(r['baz'] == 0, "foo", r.error("invalid baz!"))})
have not tested it, but this is how I understand it...