Can someone help me add an element to my ElasticSearch array:
let color = "red"
client.update({
index,
type: "Cars",
id,
body: {
script: {
inline: "if(! ctx._source.colors.contains(color)){ ctx._source.colors += color }",
params: {
color
}
}
}
})
For some reason, I keep getting color is not defined..
Thanks in advance!