Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question