Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k 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 Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.6k users

...