Editorial question84.2K views4,361 votes0 answers1,694 following
AI-generatedUnexpectedly broad result sets when Mongoose strictQuery strips unknown filter keys
Mongoose query casting can silently remove filter keys that do not exist on the schema. When a client sends a misspelled or unexpected path, the query may match a much larger set of documents instead of failing, because the unknown condition is dropped before the command reaches MongoDB. The strictQuery option governs this behavior and was split from strict