chroma
chroma copied to clipboard
[Bug]: Operator $in and $nin do not exist.
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
Please upgrade to 0.4.9. Those operators were released in that version.
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?
Unfortunately we don't have versioned documentation yet. We 100% want to do that.
0.4.9 is the latest stable release.
Does JavaScript version support the $in and $nin in where operators?
The current version is chromadb 1.5.9
@lanvige, PR for JS support is coming soon
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?
Hey all, closing this since feature is available in newer Chroma versions, and newer version of our JS-client. Please feel free to open another issue if you are running into this problem again with Chroma v0.6.0 or later.