erquhart
erquhart2y ago

Indexing on undefined

For optional fields, is there a way to index for undefined values?
4 Replies
lee
lee2y ago
Yes. Is it not working for you? (there is a weird workaround if you want effectively q.neq("field", undefined) because that syntax doesn't work, but q.eq("field", undefined) should work
erquhart
erquhartOP2y ago
ah, my own types were throwing me off, yes it works Thank you!
lee
lee2y ago
No worries. In case you're curious, the weird workaround is q.gte("field", null as any) which works because undefined < null < everything else
erquhart
erquhartOP2y ago
Oh that’s good to know!

Did you find this page helpful?