Query both unset and false
I have defined a schema documents:
The problem arrives when I try to only the non-archived documents, this is the filter I am using:
.filter((q) => q.eq("isArchived", undefined))If I attempt to filter by false instead of undefined I get a typescript error.
And in my restore function, I patch the document by setting
isArchived to false.I assume it can work by me setting the
isArchived: undefined instead of false But I feel like I am doing something wrong here?Can I query an optional, boolean field by both
undefined | false ?P.S. My
userId is a string because I dont have the need for users table atm, I just use Clerk's userId.