-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Something like:
{'x.y': {$exists: false}}
Means 'x' can be any type including any primitive and any array.
But IF 'x' is an object, it must NOT have 'y'.
The current debug string prints the type of 'x' as:
minKey|missing|undefined|null|number|string|symbol|{y: missing, ...}|array(S)|binData|objectId|bool|date|timestamp|regex|dbPointer|javascript|javascriptWithScope|maxKey
That is just too verbose. It shows every BSON type and the expected {y: missing, ...} in the object space.
We can use the following syntax instead:
~object|{y: missing, ...}
Which means no object or object with y missing. This expresses the same type as union with object negation.
If 'x' could not be null either, we could print:
~(object|null)|{y: missing, ...}