RJR
Convex Community3y ago
4 replies
RJ

Filter by unset

It would be nice if there were a way to filter by a field whose value is "unset". Given that I can now use db.patch to unset a field's value by passing in undefined (e.g. db.patch(id, { tag: undefined }), per the docs)—which is really nice!—I also expected something like

.filter((q) =>
  q.eq(q.field("tag"), q.not(undefined)),
)


to work, but it doesn't!

typescript: Argument of type 'undefined' is not assignable to parameter of type 'ExpressionOrValue<boolean>'.
Was this page helpful?