Rethinkdb atomic operations
问题 Let's say I have a document { id: 1, fruits: [] } fruits here acts as a SET Now I want to atomically add a value to fruits array for document with primary key = 1 OR create such document if it does not exist(i.e. use SetInsert ReQL under the hood) I also need to do the same for increment(ReQL .Add) Obviously this can't be done in client code as it breaks atomicity and I end up with inconsistent data I wish something like this was possible r.table('results').insert({ id: '62c70132-6516-4279