3 ms·
Do you think something like the following should work with RethinkDB? r.table('foo') .get(5) .update({ '_rev': r.branch(r['_rev'] == 5, r('
by muhqu 14y ago
Do you think something like the following should work with RethinkDB?
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.