given sample data like:
{
'id': 1,
'things': [{'name': 'a'},{'name': 'b'},{'name': 'c'}]
}
how do I update the document removing the array item with name of 'b' from the embedded array?
r.table('test')
.get(1)
.update({things: r.row('things')????});
You can use the
update
command along withfilter
to filter the elements in an array and pass to along toupdate
.Basically, you'll be overwriting
things
with the filtered array.