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

[Feature Request]: $contains for metadata or allow type list for metadata and have $in for lists as filter option #3153

Open
pascalovrai opened this issue Nov 17, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@pascalovrai
Copy link

Describe the problem

I would be awesome if you could use the $contains filter on metadata. Or if you could have a list as an allowed type for metadata, to then use a kind of $in operator.

Describe the proposed solution

So let's say I have a list of tags ("Bestseller", "Beginner-Friendly", "Budget-Friendly"). Now I have the metadata field "Tags" and there I would like to make the value of the field a list -> ["Bestseller", "Beginner-Friendly", "Budget-Friendly"]. Now if I want to look for all documents that are bestsellers, I would just have to do {"Tags": {"$in": "Bestseller"}}.

Alternatives considered

Or the same for $contains. Where you would not have to have a list as the metadata field type, but you could have a string.

Importance

i cannot use Chroma without it

Additional Information

I love Chroma DB and have been using it for around a year now and this feature would be soo life saving!!!

@pascalovrai pascalovrai added the enhancement New feature or request label Nov 17, 2024
@Sicheng-Pan
Copy link
Contributor

Hi! Currently Chroma does not support compound metadata value (such as a list). But for your use case it is possible to get around without using a list as value type. For example:

  • Given a document tagged as BestSeller and Beginner-Friendly, you can store the following metadata: {"tag:BestSeller": True, "tag:Beginner-Friendly": True}
  • When you want to query for all documents that is tagged "BestSeller", you can query the corresponding metadata key in the where clause: {"tag:BestSeller": True}

@epinzur
Copy link

epinzur commented Dec 16, 2024

this seems related to #227 and maybe a duplicate of #936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants