[Feature Request]: Support lists in metadata
Describe the problem
This issue tracks the feature request to add support for storing and querying lists as values within Chroma's metadata fields. Currently, metadata fields are limited to single values (strings, integers, floats, booleans). This limitation hinders use cases that require associating multiple values with a single metadata key, such as tags, categories, or other multi-value attributes.
Related user issues:
- #227
- #936
- #2487
- #3153
Describe the proposed solution
- Allow storing lists of primitive data types (strings, numbers, booleans) as values in metadata fields during document insertion or updates.
- Provide query operators to efficiently filter documents based on list contents. This includes, at a minimum:
$contains(or similar): To check if a list field contains a specific value.$in(or similar): To check if a list field contains any value from a given set.- Potentially other operators like
$all(contains all values),$size(matches list size), etc., based on community needs and feasibility.
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Is there are any in progress development for this solution? If not I could do it
Yes! Supporting lists in metadata would significantly improve flexibility in handling multi-value attributes
+1
Are there any plans for adding lists to metadata?
+1
Has anyone had luck converting the values in a list to keys for metadata. That’s what I’m implementing to get around this. For example if I have a list ‘tags’ with values foo and bar, metadata would look like { other items… tags_foo: 1, tags_bar: 1 }, then my metadata filter for documents tagged foo would be { tags_foo: 1 }. It’s a bit cumbersome but I’m hoping it works well enough to get around this issue. If anyone has tried this or some other workaround I’d like to hear it.
+1
+1
Yeah it is quite needed! Hope developers respond to this.
+1
+1
+1
+1
+1
+1
+1
+1 and dict as well
+1
+1
+1
+1
+1
Any news about the $contains operator?
+1