Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit fcb0bce

Browse files
committed
docs: Updated Usage Guide with infor about $in and $nin filters
Refs: chroma-core/chroma#1029
1 parent 0ed1bcd commit fcb0bce

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/usage-guide.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,37 @@ An `$or` operator will return results that match any of the filters in the list.
621621
}
622622
```
623623

624+
##### Using inclusion operators (`$in` and `$nin`)
625+
626+
The following inclusion operators are supported:
627+
628+
- `$in` - a value is in predefined list (string, int, float, bool)
629+
- `$nin` - a value is not in predefined list (string, int, float, bool)
630+
631+
An `$in` operator will return results where the metadata attribute is part of a provided list:
632+
633+
```json
634+
{
635+
"metadata_field": {
636+
"$in": ["value1", "value2", "value3"]
637+
}
638+
}
639+
```
640+
641+
An `$nin` operator will return results where the metadata attribute is not part of a provided list:
642+
643+
```json
644+
{
645+
"metadata_field": {
646+
"$nin": ["value1", "value2", "value3"]
647+
}
648+
}
649+
```
650+
651+
:::note Practical examples
652+
For additional examples and a demo how to use the inclusion operators, please see provided notebook [here](https://github.com/chroma-core/chroma/blob/main/examples/basic_functionality/in_not_in_filtering.ipynb)
653+
:::
654+
624655
<Tabs queryString groupId="lang" className="hideTabSwitcher">
625656
<TabItem value="py" label="Python">
626657

0 commit comments

Comments
 (0)