{"record":{"id":"0823966957427eae","repo":"Automattic/mongoose","slug":"parameter-filter-to-this-op-must-be-an-obje","errorCode":null,"errorMessage":"Parameter \"filter\" to ${this.op}() must be an object, got \"${value}\" (type ${typeof value})","messagePattern":"Parameter \"filter\" to (.+?)\\(\\) must be an object, got \"(.+?)\" \\(type (.+?)\\)","errorType":"exception","errorClass":"ObjectParameterError","httpStatus":null,"severity":"error","filePath":"lib/query.js","lineNumber":531,"sourceCode":"  p[path] = { $slice: val };\n  this.select(p);\n\n  return this;\n};\n\n/*!\n * ignore\n */\n\nconst validOpsSet = new Set(queryMiddlewareFunctions);\n\nQuery.prototype._validateOp = function() {\n  if (this.op != null && !validOpsSet.has(this.op)) {\n    this.error(new Error('Query has invalid `op`: \"' + this.op + '\"'));\n  }\n\n  if (this.op !== 'estimatedDocumentCount' && this._conditions == null) {\n    throw new ObjectParameterError(this._conditions, 'filter', this.op);\n  }\n};\n\n/**\n * Specifies the complementary comparison value for paths specified with `where()`\n *\n * #### Example:\n *\n *     User.where('age').equals(49);\n *\n *     // is the same as\n *\n *     User.where('age', 49);\n *\n * @method equals\n * @memberOf Query\n * @instance\n * @param {object} val","sourceCodeStart":513,"sourceCodeEnd":549,"githubUrl":"https://github.com/Automattic/mongoose/blob/49cdab01366679723b487ecb754b38570f783289/lib/query.js#L513-L549","documentation":"Error \"Parameter \"filter\" to ${this.op}() must be an object, got \"${value}\" (type ${typeof value})\" thrown in Automattic/mongoose.","triggerScenarios":"Thrown at lib/query.js:531 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49cdab01366679723b487ecb754b38570f783289","analyzedAt":"2026-08-21T22:54:00.882Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}