When I try to lookup something within my fulldocument my changestream fails with this error: “MongoServerError[ChangeStreamFatalError]: PlanExecutor error during aggregation :: caused by :: cannot resume stream; the resume token was not found.”
When I run exactly the same change stream but omit the lookup against the full document there’s no exception. Anyone knows what the issue is here?
Here’s an example:
const watchCursor = db.getCollection('eventStore.in').watch(
[
{
$match: {
$and: [
{ 'fullDocument.State': 'Queued' }, //Removing this line "resolves" the bug.
{
$or: [
{ 'operationType': 'insert' },
{ 'operationType': 'update' }
]
}
]
}
}
],
{
fullDocument: "updateLookup",
startAfter: {_data: "<redacted>"}
});
while (!watchCursor.isClosed()){
if (watchCursor.hasNext()){
print(watchCursor.next());
}
}