naftali
November 22, 2019, 6:52pm
1
(How) Can I pass in a complex path argument to OJBECT_PUT’s attr_key param?
say I have
let x =
{
“toplevel1”: 1,
“toplevel2”:2,
“toplevel3”: {
“secondlevel”: 3
}
}
I want to do OBJECT_PUT(x, ‘toplevel3’.‘secondlevel’, ‘newValue’)
I’ve tried ‘top’.‘next’ and top
.next
.
Neither seem to work and appear to null out the object (which is an issue in and of itself)
vsr1
November 22, 2019, 7:21pm
2
OBJECT_PUT(arg1, arg2, arg3)
arg2 must be identifier not a dotted path.
Depends on where u use you can do this
OBJECT_PUT(x.toplevel3, secondlevel, newValue) The return value will be x.toplevel3 not x
OBJECT_PUT(x, toplevel3, OBJECT_PUT(x.toplevel3, secondlevel, newValue) ) gives x
1 Like
naftali
November 22, 2019, 7:51pm
3
thank you, as usual, clear and pertinent.
can you speak to whether and where update using joins is on the roadmap?
vsr1
November 22, 2019, 9:50pm
4
At present you can explore MERGE option (ANSI merge in 6.50 beta).
1 Like
binh.le
November 25, 2019, 2:54pm
5
Hi @naftali ,
Supporting UPDATE JOIN is planned for future release. I have created https://issues.couchbase.com/browse/MB-37051 to track this.
1 Like