我有一个数组,看起来像这样:
"_source": {
"dateCreated": "2023-07-12",
"sources": [
{
"1": null,
"lastUpdateDate": "2023-08-10T11:12:36.9848505",
"postedDate": "2023-08-10T10:38:57.9440773"
如何从sources数组更新postedDate?
我已经设法用这个查询更新了dateCreated:
POST index/_update_by_query
{
"script": {
"source": "ctx._source.dateCreated='2023-07-12'",
"lang": "painless"
},
"query": {
"terms": {
"_id": [
"12345"
]
}
}
}
1条答案
按热度按时间anauzrmj1#
你可以这样做,通过访问数组: