How to find the resumeToken position in the Oplog

Hi!

I try to monitor how many changes in the change stream have not been processed yet,
I can count the total amount by aggregate group+count (filtered by collection),
but how do I count the number of tokens after the resume token?

Thank you.

Hi @Shay_I and welcome to the community!!

The general recommendation is not to the query the oplog directly. Instead you might be able to do by decoding the timestamp from the resumeToken and then querying the oplog based on the timestamp.

The following mongosh ticket might prove to be useful in your scenario.

Please let us know if you need any further assistance.

Thanks
Aasawari