SERVER-134937ClosedFixed
Implement InternalSchemaTypeExpression narrowing
Implement narrowType for InternalSchemaTypeExpression. It carries the same MatcherTypeSet as $type, but uses ElementPath with LeafArrayBehavior::kNoTraversal and NonLeafArrayBehavior::kTraverse. The expression is generated from $jsonSchema but we can test it directly too. {x: \{$_internalSchemaType: number}} with x = any -> x is number {x: \{$not: {$_internalSchemaType: number}}} with x = any -> x is any except number {x: \{$_internalSchemaType: [number, string]}} with x = any -> x is nu