I am looking to retrieve all columns from a table using the following code snippet. Is there a more efficient way to achieve this? I couldn't find any information in the documentation. Does anyone have a workaround or solution?
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'm trying to prevent redundant data retrieval.
Documentation: