Hi!
Can i do something like this in n1ql?
update bucket use keys [“id::a”, “id::b” ] set num = (position of id)** in array_position([“id::a”, “id::b”], id) returning bucket.num;
** i need this to be the position of the key in the array
If for example before statement execution the documents was:
id::a {
“num”: 0
}
id::b{
“num”: 0
}
After the execution will be:
id::a {
“num”: 1
}
id::b{
“num”: 2
}