glucinaterG
Convex Community2y ago
4 replies
glucinater

Advanced Filtering

Is there any way to filter with argument basic processing on the q.field() attribute? I am wary of using a searchIndex because I only want to return an item if it fits the criteria exactly. An example would be this:

 const course = await ctx.db
            .query("courses")
            .filter((q) => q.and(
                q.eq(q.field("Subject").toLowerCase(), args.Subject.toLowerCase()),
                q.eq(q.field("Catalog"), args.Catalog)
                )
            ).first();
Was this page helpful?