0

I am using RethinkDB, and my rows have nested objects. If a field is a value, I want it overwritten, however, if it is a an array, I want to the old and new values to be concatenated. Thus, for a nested, object, I want the same behavior.

I was hoping this line of code would do the trick

r.branch(row(field).typeOf().eq('ARRAY'), row(field).add(data[field]),
                r.branch(row(field).typeOf().eq('OBJECT'), deepcopy(data[field], row(field)),data[field]));

However, in the nested branch, if an object is a string, it comes out as true. What is the appropriate check?

Gakho
  • 603
  • 1
  • 9
  • 18

0 Answers0