Not getting any events when listening to 'resumeTokenChanged' event in MongoDB Change Stream

I have a NodeJS application which listens to change stream events. One thing I noticed is that when listening to the ‘resumeTokenChanged’ on one DB, I get events almost every second even though there are no activities done on the collection, while on another DB I will not get any ‘resumeTokenChanged’ events if there are no activities on the collection.

When a resume token is changed, I will store it in the DB so that I can resume the change stream in case my application crashes. I have several collections which have low activity on it, so I’m listening to the ‘resumeTokenChanged’ event to store the latest resume token for that collection. If I do not do this, the resume token I get from a change event might roll off the oplog after awhile, then resuming the change stream will fail.

I need to have the behavior of the first DB. Any idea why the difference in behavior between the two DBs? Both DBs are the same version 4.0.14.

I appreciate if anyone can help, thank you!

Hi, could you please share how you solved the problem? Did you use the change stream token from the resumeTokenChanged event? I noticed you receive the resume token from this event every second, but it seems like it’s a different token from what you get from the change event. However, with both of them, you can start the change stream. Do you know the difference, or the pros and cons of using each one?