I have this object:
{
"id": "eb533cd0-fef1-48bf-9fb8-b66261c9171b" ,
"errors": [
"error1" ,
"error2"
]
}
I simply want to append a new error to errors array. I tried:
r.db('test').table('taskQueue').get("eb533cd0-fef1-48bf-9fb8-b66261c9171b").update({'errors': r.row['errors'].append('appended error')})
but this did not work. It gives this error: "TypeError: r.row.errors is undefined"
My question is how to append an array?
eb533cd0-fef1-48bf-9fb8-b66261c9171b
is a huge document, will going.get
first not be expensive? e.g. would there be a way to just append an element directly into the datatype, instead of fetching the full document and then replacing the entire array in it? – Mayworm