Fixed upgrade to latest MongoDB driver
MODIFY
src/storage/mongodb/MongoDBStorage.ts
src/storage/mongodb/MongoDBStorage.ts
@@ -77,12 +77,11 @@ export default class MongoDBStorage {
});
// Trigger callbacks
changeStream.on('change', (changeStreamDocument: ChangeStreamDocument) => {
- console.log(changeStreamDocument);
- // const documentID = changeStreamDocument.documentKey ? changeStreamDocument.documentKey['_id'] : null;
- // const documentChange = changeStreamDocument.operationType;
- // const fullDocument = changeStreamDocument.fullDocument;
- // // Callback
- // callback(documentID, documentChange as DatabaseDocumentChange, fullDocument);
+ const documentID = changeStreamDocument['documentKey'] ? changeStreamDocument['documentKey']['_id'] : null;
+ const documentChange = changeStreamDocument.operationType;
+ const fullDocument = changeStreamDocument['fullDocument'];
+ // Callback
+ callback(documentID, documentChange as DatabaseDocumentChange, fullDocument);
});
}

Fixed upgrade to latest MongoDB driver