isaac_wayI
Convex Community3w ago
11 replies
isaac_way

Idiomatic "in" query in Convex

AFAIK the only way to mimick an "in" query in convex is like:

    const sessions = await Promise.all(
      args.sessionIds.map((id) => ctx.db.get(id))
    );


Which feels really wrong because it reads as "for every session id make one query to the database", which seems really ineffecient (but IDK how it works under the hood so maybe not).

- Is above the correct way to do an "in" query?
- Is this making one DB query per record?
Was this page helpful?