4 Replies
Here is more detailed explanation of my concern:
1) I have many-to-many relation done with dedicated table. Projects <-> Manages <-> Users
2) During fetching project data I do indexed search of manage's records with
withIndex("by_project", args.id)
3) I need to fetch all users from received list of manages
records.
Currently I see only one option: use map
over ids and separate queries for each.
In short: I'm looking for something such as:
db.query('users').withIndex("by_id", q => q.in("_id", userIds))
Mapping as you mentioned originally is the right approach. https://docs.convex.dev/database/reading-data#join
Reading Data | Convex Developer Hub
Query and
Recommend checking out the tutorial to get the basics: https://docs.convex.dev/tutorial/
Convex Tutorial: A Chat App | Convex Developer Hub
Convex provides you with a fully featured backend with cloud functions,
The AI assistant in #ask-ai is really good for this stuff too (it’s available in the docs as well).