• Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 number|string
      {$jsonSchema: {required: ['a'], properties: {a: {bsonType: 'number', maximum: 10}}}} -> a is number

            Assignee:
            Matt Olma
            Reporter:
            Vesko Karaganev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: