How to get the document pre-image when using change stream in delete

I am getting fullDocumentBeforeChange: null on operationType: 'delete' when trying:

db.watch([], {
  fullDocument: "updateLookup",
  fullDocumentBeforeChange: "whenAvailable",
}).on("change", (data) => {})

How can I get the pre-image of the deleted document when using change stream?

Hello @WONG_TUNG_TUNG ,

Please check

Regards,
Tarun

1 Like

Can I enable changeStreamPreAndPostImages in Mongodb Atlas without typing the command or using Mongoose?