I have a field that can have 3 states: true, false and undefined.
Each represents a different scenario.
-
Would using
query.equalTo("colName", undefined)
be more performant as it would allow utilizing an index vsquery.notContainedIn("colName", [true, false])
? or will the value of undefined prevent MongoDB from utilizing the index, and therefore I should go with notContainedIn? -
Also would
query.equalTo("colName", undefined)
be better thanquery.doesNotExist("colName")
?
Thank you