Reputation: 19035
I want to replace a nested object with another object.
Is this the simplest way to express that?
r.expr({ foo: {bar: 1}, eck: true })
.merge({ foo: null }, { foo: {zim: 1} })
// Expected output: { foo: {zim: 1}, eck: true }
Upvotes: 1
Views: 71
Reputation: 19035
You can use r.literal
for this: https://www.rethinkdb.com/api/javascript/literal
r.expr({ foo: {bar: 1}, eck: true })
.merge({ foo: r.literal({zim: 1}) })
Upvotes: 2