{"record":{"id":"6e00ff91680e4075","repo":"Automattic/mongoose","slug":"cast-to-number-failed-for-value-stringvalue-ty-6e00ff","errorCode":null,"errorMessage":"Cast to Number failed for value ${stringValue} (type ${valueType}) at path \"skip\"","messagePattern":"Cast to Number failed for value (.+?) \\(type (.+?)\\) at path \"skip\"","errorType":"exception","errorClass":"CastError","httpStatus":null,"severity":"error","filePath":"lib/query.js","lineNumber":973,"sourceCode":" *\n * Cannot be used with `distinct()`\n *\n * @method skip\n * @memberOf Query\n * @instance\n * @param {number} val\n * @see cursor.skip https://www.mongodb.com/docs/manual/reference/method/cursor.skip/\n * @api public\n */\n\nQuery.prototype.skip = function skip(v) {\n  this._validate('skip');\n\n  if (typeof v === 'string') {\n    try {\n      v = castNumber(v);\n    } catch {\n      throw new CastError('Number', v, 'skip');\n    }\n  }\n\n  this.options.skip = v;\n  return this;\n};\n\n/**\n * Specifies the batchSize option.\n *\n * #### Example:\n *\n *     query.batchSize(100)\n *\n * #### Note:\n *\n * Cannot be used with `distinct()`\n *","sourceCodeStart":955,"sourceCodeEnd":991,"githubUrl":"https://github.com/Automattic/mongoose/blob/49cdab01366679723b487ecb754b38570f783289/lib/query.js#L955-L991","documentation":"Error \"Cast to Number failed for value ${stringValue} (type ${valueType}) at path \"skip\"\" thrown in Automattic/mongoose.","triggerScenarios":"Thrown at lib/query.js:973 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"}