D
D
dfhkjhg2020-07-09 23:47:18
JavaScript
dfhkjhg, 2020-07-09 23:47:18

Is it possible to find out when was the last change in mongodb?

There is a code that takes data from the database every 5 seconds. I want to add a check that if the data has not been updated during these 5 seconds, then the script will not do anything. Is it possible to find out somehow when the data was last updated or will I have to write the time of the last update to the database myself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptKiddo, 2020-07-09
@ScriptKiddo

MongoDB does not store the last modified date of a document. You need to store it in a separate field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question