{"record":{"id":"7cd7d7dc45f323e7","repo":"chroma-core/chroma","slug":"limit-can-only-be-specified-when-a-where-or-whered","errorCode":null,"errorMessage":"limit can only be specified when a where or whereDocument clause is provided","messagePattern":"limit can only be specified when a where or whereDocument clause is provided","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/collection.ts","lineNumber":862,"sourceCode":"      ids,\n      embeddings,\n    };\n  }\n\n  private validateDelete(\n    ids?: string[],\n    where?: Where,\n    whereDocument?: WhereDocument,\n    limit?: number,\n  ) {\n    if (ids) validateIDs(ids);\n    if (where) validateWhere(where);\n    if (whereDocument) validateWhereDocument(whereDocument);\n    if (limit !== undefined && (!Number.isInteger(limit) || limit < 0)) {\n      throw new Error(\"limit must be a non-negative integer\");\n    }\n    if (limit !== undefined && !where && !whereDocument) {\n      throw new Error(\n        \"limit can only be specified when a where or whereDocument clause is provided\",\n      );\n    }\n  }\n\n  public async count(options?: { readLevel?: ReadLevel }): Promise<number> {\n    const { data } = await RecordService.collectionCount({\n      client: this.apiClient,\n      path: await this.path(),\n      query: options?.readLevel ? { read_level: options.readLevel } : undefined,\n    });\n\n    return data;\n  }\n\n  public async add({\n    ids,\n    embeddings,","sourceCodeStart":844,"sourceCodeEnd":880,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/collection.ts#L844-L880","documentation":"Error \"limit can only be specified when a where or whereDocument clause is provided\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at clients/new-js/packages/chromadb/src/collection.ts:862 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":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}