Closed Andre601 closed 6 years ago
If I understand you correctly, this could be achieved using a predicate function. For instance, in JavaScript:
r
.table('Messages')
.filter(message => message('color').eq('color_green'))
.update('green')
There's some examples of this in the documentation. The query language is very powerful for operations like this.
ok. I'll take a look at that. thanks for the help.
I want to change some values, that are stored in RethinkDB. The issue is, that there are multiple entries with different tables and such and I don't really go through each one by one to update the values. I also only want to change a value, if the old one is a certain one.
Example: I have a table, where (after the ID) three values are stored: message, color and name. Now I want to update all the values in
color
togreen
, but only if the current value of that entry iscolor_green
. Is there a way, to achieve this (tl;dr a advanced filter and replace-method.)?