0

[MONGOOSE] DeprecationWarning: Mongoose: the strictQuery option will be switched back to false by default in Mongoose 7. Use mongoose.set('strictQuery', false); if you want to prepare for this change. Or use mongoose.set('strictQuery', true); to suppress this warning. (Use node --trace-deprecation ... to show where the warning was created)

Please help me out to get it resolve

  • Check this answer https://stackoverflow.com/a/74713539/13211263.. – lpizzinidev Dec 12 '22 at 07:36
  • Does this answer your question? [how to fix Mongoose Deprecation Warning "the strictQuery"](https://stackoverflow.com/questions/74711770/how-to-fix-mongoose-deprecation-warning-the-strictquery) – lpizzinidev Dec 12 '22 at 07:37

1 Answers1

0

Added deprecation warning https://github.com/Automattic/mongoose/pull/12675. Just add mongoose.set before your mongoose.connect to suppress the warning.

mongoose.set('strictQuery', true);

mongoose.connect(// codes)
Titan XP
  • 399
  • 3
  • 11