Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-10734

Docs for SERVER-30245: Extend JSON Schema parser to handle the type keyword containing an array of types

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.13
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Documentation Request Summary:

      The $type query operator can now accept an array of types. For instance, the query

      db.coll.find({telephone: {$type: ["number", "string"]}});
      

      matches as long as the type of the telephone field is either a number or a string. The elements of the array can be either string aliases or numerical type codes. The following query uses numerical type codes to find documents where num is either NumberInt or NumberLong:

      db.coll.find({num: {$type: [16, 18]}};
      

            Assignee:
            pavithra.vetriselvan@mongodb.com Pavithra Vetriselvan
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              6 years, 36 weeks, 1 day ago