How can I index/filter my database for tags (array of strings)
I have a filter selector, which returns an individual filter as a string. I'm trying to use this to index through my database and return results that have that as a tag. However, I can't seem to figure this out through indexing. Am I missing something? Here's my schema code and my current boilerplate code:
and my query:
Am I doing something wrong with how I index? For exampl,e I get the error on the filter variable within
withIndex
:
Argument of typing 'string' is not assignable to parameter of type 'string[]'Thanks!
3 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Additionally, It works with this code:
but is this the most optimal?
Convex AI recommends using a join table appraoch, having a separate table for tags - but is this the best way?
Exactly storing them in different table will be much faster and recommend way