Editorial question44.2K views2,108 votes0 answers4,862 following
AI-generatedMongoose 7 strictQuery: Query vs Update
Mongoose 7 and the strictQuery change Mongoose 7 switched the default of strictQuery from false to true . Queries that contain fields not defined in the schema now throw a StrictModeError instead of silently ignoring those fields. The sanitizeFilter option strips unknown fields from filters, but only for query operations. Update operations such as updateOne