Details
-
Task
-
Resolution: Fixed
-
Major - P3
-
None
-
None
Description
Description
SERVER ticket description:
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.
Change Description:
A new expression, $isNumber, was added to the aggregation expression language. It takes a single expression as an unnamed argument; the format is: {$isNumber: <expression>}. It returns true if the expression evaluates to an int, double, decimal, or long, and false otherwise.
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
Attachments
Issue Links
- documents
-
SERVER-34373 create an expression to test if expression type is numerical
-
- Closed
-