Let's imagine this situation Alice and Bob are connected to the same kuzzle server. There is a document structured like this:
{
"nom": "Festival de l'automne",
"participants": [id1, id2, ...]
}
Alice and bob want to update the document nearly at the same time.
If using kuzzle.document.update()
i have to use a previously stored value on Alice's or Bob's client to update the participants array. That can lead to conflict or data loss.
My question is is there a way to update the "participants" array using the previous values server side ? or is there a way to directly use an elasticsearch query in order to user scripts like
{
"script" : "ctx._source.participants += participants",
"params" : {
"participants" : "idx"
}
}