erquhart
erquhart13mo ago

Indexing on undefined

For optional fields, is there a way to index for undefined values?
4 Replies
lee
lee13mo 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
erquhartOP13mo ago
ah, my own types were throwing me off, yes it works Thank you!
lee
lee13mo 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
erquhartOP13mo ago
Oh that’s good to know!

Did you find this page helpful?