{"record":{"id":"e94de3ac58d94f3a","repo":"denoland/deno","slug":"selector-must-specify-either-prefix-or-both-sta","errorCode":null,"errorMessage":"Selector must specify either 'prefix' or both 'start' and 'end' key","messagePattern":"Selector must specify either 'prefix' or both 'start' and 'end' key","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"ext/kv/01_db.ts","lineNumber":888,"sourceCode":"    }\n    if (prefix) {\n      if (start && end) {\n        throw new TypeError(\n          \"Selector can not specify both 'start' and 'end' key when specifying 'prefix'\",\n        );\n      }\n      if (start) {\n        this.#selector = { prefix, start };\n      } else if (end) {\n        this.#selector = { prefix, end };\n      } else {\n        this.#selector = { prefix };\n      }\n    } else {\n      if (start && end) {\n        this.#selector = { start, end };\n      } else {\n        throw new TypeError(\n          \"Selector must specify either 'prefix' or both 'start' and 'end' key\",\n        );\n      }\n    }\n    ObjectFreeze(this.#selector);\n    this.#pullBatch = pullBatch;\n    this.#limit = limit;\n    this.#reverse = reverse;\n    this.#consistency = consistency;\n    this.#batchSize = batchSize;\n    this.#cursorGen = cursor ? () => cursor : null;\n  }\n\n  get cursor(): string {\n    if (this.#cursorGen === null) {\n      throw new Error(\"Cannot get cursor before first iteration\");\n    }\n","sourceCodeStart":870,"sourceCodeEnd":906,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/ext/kv/01_db.ts#L870-L906","documentation":"Error \"Selector must specify either 'prefix' or both 'start' and 'end' key\" thrown in denoland/deno.","triggerScenarios":"Thrown at ext/kv/01_db.ts:888 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":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}