The-Ultimate-Guide-to-TypeScript-With-Mongoose
The-Ultimate-Guide-to-TypeScript-With-Mongoose copied to clipboard
Please add the watch functionality too
Hi, you miss the watch/change stream functionality. please add it. When I do this:
const userChangeStream = UserModel.watch();
userChangeStream.on('change', async (doc) => {
if (doc.operationType === 'update') {
console.log(doc.documentKey._id.toHexString()); // Object is of type 'unknown'.
}
}
What can I do?