Skip to content

Instantly share code, notes, and snippets.

@neumino
Created May 19, 2013 14:36
Show Gist options
  • Save neumino/5607840 to your computer and use it in GitHub Desktop.
Save neumino/5607840 to your computer and use it in GitHub Desktop.
Update nested object
r.db('test').table('test').update(function(doc) {
return r.branch(
doc('skills').contains('html'),
doc.merge({skills: doc('skills').merge({'html': doc('skills')('html').add(3)})}),
doc.merge({skills: doc('skills').merge({'html': 3})})
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment