[SERVER-34373] create an expression to test if expression type is numerical Created: 07/Apr/18  Updated: 29/Oct/23  Resolved: 01/Aug/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Improvement Priority: Major - P3
Reporter: Asya Kamsky Assignee: George Wangensteen
Resolution: Fixed Votes: 0
Labels: expression, pm1457, usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-730 Create an expression to test if expre... Closed
Documented
is documented by DOCS-12936 Investigate changes in SERVER-34373: ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2019-07-29, Query 2019-08-12
Participants:

 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.



 Comments   
Comment by Githook User [ 01/Aug/19 ]

Author:

{'name': 'George Wangensteen', 'email': 'george.wangensteen@10gen.com'}

Message: SERVER-34373 add aggregation expression to test if type is numeric
Branch: master
https://github.com/mongodb/mongo/commit/ed3c15b7de3871b6b75a0058d0e1ccea1e9c3a86

Generated at Thu Feb 08 04:36:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.