Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-34373

create an expression to test if expression type is numerical

    • Fully Compatible
    • Query 2019-07-29, Query 2019-08-12

      Currently to determine if type of expression is a number you have to do this:

      {$in:[ {$type:"$expression"}, ["int", "long", "double", "decimal"] ]}
      

      It would be nice to have shorthand syntax for this test. Maybe $isNumeric or $isNumber?

      Note that query/matcher already supports {a:{$type:"number"}} but not agg.

            Assignee:
            george.wangensteen@mongodb.com George Wangensteen
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: