I have the following basic snippet of code and my aim is to get the fullDocument property from the obj: ChangeEvent
however I am not able to access this property (Property 'fullDocument' does not exist on type 'ChangeEvent<any>'
). The only properties I can access are _id, clusterTime and operationType. Is there something I am missing or should I just query the fullDocument non-directly (obj['fullDocument']
)?
const changeStream = this.model.watch([], { fullDocument: 'updateLookup' })
.on('change', obj => {
console.log(obj.fullDocument);
});
question from:https://stackoverflow.com/questions/65861573/nestjs-mongoose-cannot-access-fulldocument-on-changeeventany