Painless updating Array of custom objects
But below script is not working. Please let me know the solution:
code = "ctx._source.attachments.add([" +
""attachmentId" : params.attachmentId," +
""size" : params.size," +
""type" : params.type," +
""file_name" : params.file_name" +
"]);";
Below is working fine:
{
"script": {
"inline": "ctx._source.attachments.add(["first" : params.first, "last" : params.last]);",
"params": {
"first": "123", "last": "456"
}
}
}