You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 10, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/usage-guide.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -621,6 +621,37 @@ An `$or` operator will return results that match any of the filters in the list.
621
621
}
622
622
```
623
623
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)
0 commit comments