Reputation: 5132
Using update query for document as follows:
/<indexname>/_update/<id>
{
doc: {
/// the doc here
}
}
Is there a way, I can put condition like created_at field in the existing doc is less than created_at we are passing?
Upvotes: 0
Views: 1763
Reputation: 7854
You are probably looking for update by query api.
e.g.
POST <index>/_update_by_query
{
"query": {
"range": {
"created_at": {
"lte": "2019-01-10"
}
}
}
}
Upvotes: 2