I need to add a card object to list of cards
use "elasticsearch": "^16.7.3", and "@types/elasticsearch": "^5.0.43",
i try this code:
const theScript = {
"inline": "ctx._source.cards.add(card)"
}
const client: Client = await this.elastic.client;
let result: CardDto = card;
const response = await client.updateByQuery({
index: "index",
type: "type",
body: {
"query": { "match" : { "id" : idUser}},
"script" : theScript,
"params" : {
"card" : `num1 : ${card.num1},
num2: ${card.num2},
num3 : ${card.num3}`
}}});
if(response){
console.log(response);
}
return result;
}
but i get problem with the params and the query
here what i get in postMan : [parsing_exception] Unknown key for a START_OBJECT in [params]., with { line=1 & col=45 }"
Two issues
Haven't tested this, but please try: