If I wanted to update an existing document if it satisfies the condition. See an example below:
Add tweet and lastupdated fields to document 1 as below. Please note that the lastupdated field is of type date and has epoch value.
"tweet" : "tweet1",
"lastupdated" : "2019-04-04T12:01:42.834Z"
I want to update the document only if the updated_at greater than the current existing.
how can i write this using script?