Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

model - NestJS-Mongoose: cannot access fullDocument on ChangeEvent<any>

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...