Is there a way to get only few selected columns from the Convex database?

45 Views Asked by At

This snippet of code fetches all the columns from the table, is there a way to do that, I didn't find any thing in the docs, does someone know a trick or something

const documents = await ctx.db
            .query("documents")
            .withIndex("by_user", (q) => (
                q.eq("userId", userId)
            ))
            .filter((q) => (
                q.eq(q.field("isArchived"), false)
            ))
            .order("desc")
            .collect();

I want to avoid fetching same data multiple times

Docs: https://docs.convex.dev/

0

There are 0 best solutions below