Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Operator $in and $nin do not exist. #1105

Open
JanBeelte opened this issue Sep 6, 2023 · 6 comments
Open

[Bug]: Operator $in and $nin do not exist. #1105

JanBeelte opened this issue Sep 6, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@JanBeelte
Copy link

What happened?

The documentation talks about $in and $nin operators here and here
However the validate_where function throws:
ValueError: Expected where operator to be one of $gt, $gte, $lt, $lte, $ne, $eq, got $nin

Browsing through the code I do not see $in and $nin mentioned anywhere.

Versions

Chroma v0.48, Python 3.11.3, Manjaro Linux

Relevant log output

Traceback (most recent call last):
  File "print_chroma.py", line 31, in <module>
    file = collection.get(
           ^^^^^^^^^^^^^^^
  File "lib/python3.11/site-packages/chromadb/api/models/Collection.py", line 125, in get
    where = validate_where(where) if where else None
            ^^^^^^^^^^^^^^^^^^^^^
  File "lib/python3.11/site-packages/chromadb/api/types.py", line 243, in validate_where
    raise ValueError(
ValueError: Expected where operator to be one of $gt, $gte, $lt, $lte, $ne, $eq, got $nin
@JanBeelte JanBeelte added the bug Something isn't working label Sep 6, 2023
@HammadB
Copy link
Collaborator

HammadB commented Sep 6, 2023

Please upgrade to 0.4.9. Those operators were released in that version.

@JanBeelte
Copy link
Author

If I understand correctly 0.48 is the current „stable“ release, should the documentation not always feature that version? Is it possible to check the documentation of a specific version?

@HammadB
Copy link
Collaborator

HammadB commented Sep 6, 2023

Unfortunately we don't have versioned documentation yet. We 100% want to do that.

0.4.9 is the latest stable release.

@lanvige
Copy link

lanvige commented Sep 18, 2023

Does JavaScript version support the $in and $nin in where operators?

The current version is chromadb 1.5.9

@tazarov
Copy link
Contributor

tazarov commented Sep 18, 2023

@lanvige, PR for JS support is coming soon

HammadB pushed a commit that referenced this issue Sep 20, 2023
Refs: #1105

## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - JS Client support for $in and $nin

## Test plan
*How are these changes tested?*

- [x] Tests pass locally `yarn test` for js

## Documentation Changes
TBD
@aadityarajkumawat
Copy link

chroma v1.8.1

Still running into this error:

  const vectorDocs = await vectorCollection.get({
      where: {
        knowledgeBaseId: {
          $in: knowledgeBaseIds, // array of strings
        },
      },
    });

Error:

{
  error: "ValueError('Expected where operator to be one of $gt, $gte, $lt, $lte, $ne, $eq, got $in')"
}

Am i querying it wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants