What’s the best way to assign a unique timestamp whenever the document is created or updated ?
Client(s) can use that timestamp to get the updated / new documents from the last timestamp.
What’s the best way to assign a unique timestamp whenever the document is created or updated ?
Client(s) can use that timestamp to get the updated / new documents from the last timestamp.
It depends what version of the server you are using.
Prior to 4.2 you should use $currentDate
operator , but starting 4.2 you can use $$NOW
or $$CLUSTER_TIME
:
Best,
Pavel