chroma-core/chroma · error · ChromaValueError

modify() is not supported on a collection obtained via clien

Error message

modify() is not supported on a collection obtained via client.collection(id). Use client.getCollection() to get a full collection instance.

What it means

Error "modify() is not supported on a collection obtained via client.collection(id). Use client.getCollection() to get a full collection instance." thrown in chroma-core/chroma.

Source

Thrown at clients/new-js/packages/chromadb/src/collection.ts:1872

    searches: SearchLike | SearchLike[],
    options?: { readLevel?: ReadLevel },
  ): Promise<SearchResult> {
    const items = Array.isArray(searches) ? searches : [searches];
    for (const search of items) {
      const payload = toSearch(search).toPayload();
      if (this.hasStringKnnQuery(payload.rank)) {
        throw new ChromaValueError(HANDLE_EMBEDDING_ERROR);
      }
    }
    return super.search(searches, options);
  }

  public override async modify(_args: {
    name?: string;
    metadata?: CollectionMetadata;
    configuration?: UpdateCollectionConfiguration;
  }): Promise<void> {
    throw new ChromaValueError(`modify() ${HANDLE_NOT_SUPPORTED_ERROR}`);
  }

  public override async fork(_args: { name: string }): Promise<Collection> {
    throw new ChromaValueError(`fork() ${HANDLE_NOT_SUPPORTED_ERROR}`);
  }

  private hasStringKnnQuery(obj: unknown): boolean {
    if (!obj || typeof obj !== "object") return false;
    if (Array.isArray(obj)) {
      return obj.some((item) => this.hasStringKnnQuery(item));
    }
    const record = obj as Record<string, unknown>;
    if ("$knn" in record && isPlainObject(record.$knn)) {
      const knn = record.$knn as Record<string, unknown>;
      if (typeof knn.query === "string") return true;
    }
    return Object.values(record).some((value) => this.hasStringKnnQuery(value));
  }

View on GitHub (pinned to aecdd12c8a)

When it happens

Trigger: Thrown at clients/new-js/packages/chromadb/src/collection.ts:1872 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/873a5d286422946b. Report an issue: GitHub.