I've skimmed thru search.convex.dev but couldnt find any answer. is it possible to optionally filter an arg?
export const listTasks = query({
args: {
dateBegin: v.optional(v.string()),
},
handler: async (ctx, args) => {
const tasks = await ctx.db
.query(TASK_DB)
.filter((q) =>
q.and(
args.dateBegin !== ""
? q.gte(q.field("scheduledTime"), Number(args.dateBegin) * 1000)
: q.truthy(), // is this available?
...
)
)
.collect()
}
})
thanks!