Not Able to Get Pre Image in Change Streams

I’m getting this error when firing update query from mongoose but not getting any error when updating document from Compass.

MongoServerError: Executor error during getMore :: caused by :: Change stream was configured to require a pre-image for all update, delete and replace events, but the pre-image was not found for event:

Using Mongoose version 6.3.x and Mongo server- 6.x

I am also facing the same issue. Did you find any solution? -Thanks!

Hi @Sachin_Bansal,

Could you please confirm the MongoDB version you are using currently? As mentioned in the documentation, it is available from version 6.0 onwards. For more information, please refer to the documentation.

Best regards,
Kushagra

Thanks for your response.

I was able to get this resolved. The problem was on my end. In my go based API, I was using db.Collection() method followed by collMod. I didn’t realize that the collection didn’t get created by the above API, but actually was being created later when I added documents to my collection. This meant that the collMod actually had failed because of collection not being present.

1 Like

Thanks, @Sachin_Bansal for sharing your learning with the community. We’re glad that it got resolved. :blush:

Please feel free to create a new post in case you have any other questions.

Best regards,
Kushagra :star2: