w3cW
Convex Community12mo ago
3 replies
w3c

Querying array fields in Convex

I have a question about querying array fields in Convex.
In my schema, articles have a 'tagIds' array field:

articles: defineTable({
  tagIds: v.array(v.id("tags")),
  // other fields...
}).index("by_tags", ["tagIds"])


How can I query for all articles that contain a specific tagId, regardless of what other tags they might have? Is array filtering possible in the query, or do I need to query all articles and filter in memory?
Was this page helpful?