Upsert Document on the basis of datetime format


If I wanted to update an existing document if it satisfies the condition. See an example below:

Index: test_index

  1. Add tweet and lastupdated fields to document 1 as below. Please note that the lastupdated field is of type date and has epoch value.
    PUT test_index
    "tweet" : "tweet1",
    "lastupdated" : "2019-04-04T12:01:42.834Z"

  2. I want to update the document only if the updated_at greater than the current existing.

how can i write this using script?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.