Thank you.
Sorry that I forgot to update here with another similar post updated.
There are 2 issues I found out:
-
The isoformat() will return a string format which cannot be used in the query to compare with ISODate in the collection record directly. Somehow the query doesn’t return any error but always 0 which delayed the finding of the cause.
-
The clusterTime or BSON Timestamp from change stream doesn’t have the milliseconds part and so using it to check any new changes may not always work which made me try isoformat() in 1 since I found the log of the converted date doesn’t have “Z” between date and time but a space instead and isoformat() makes the log looking correct with “Z”.
So what I need is the milliseconds part to be included in the change stream to have reliable timestamp to compare.
Thank you!
Mary