[SERVER-19243] Allow $type to support "number" as type value Created: 01/Jul/15  Updated: 05/Feb/16  Resolved: 13/Jul/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.1.3
Fix Version/s: 3.1.6

Type: Improvement Priority: Minor - P4
Reporter: Qingyang Chen Assignee: Qingyang Chen
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-18819 Allow $type to support type values as... Closed
Documented
is documented by DOCS-5838 $type operator supports "number" Closed
is documented by DOCS-5883 Document "number" alias for $type Closed
Related
related to SERVER-20345 Support additional queries with $type... Backlog
is related to DRIVERS-251 Allow $type to support string represe... Closed
Backwards Compatibility: Fully Compatible
Sprint: Quint Iteration 6
Participants:

 Description   

This is an extension to SERVER-18819. We should add a "number" type to $type-supported string names that rolls up all number types.

Example:

> db.coll.drop()
> db.coll.insert({_id: 1, num: NumberInt('123')})
> db.coll.insert({_id: 2, num: NumberLong('123')})
 
> db.coll.find({num: {$type: "number"}})
{ "_id" : 1, "num" : 123 }
{ "_id" : 2, "num" : NumberLong(123) }



 Comments   
Comment by Kay Kim (Inactive) [ 06/Aug/15 ]

sorry, meant to update the docs ticket

Comment by Githook User [ 13/Jul/15 ]

Author:

{u'username': u'coollog', u'name': u'Qingyang Chen', u'email': u'qingyang.chen@10gen.com'}

Message: SERVER-19243 $type to support "number"
Branch: master
https://github.com/mongodb/mongo/commit/908313432e597623361df39339cee452176fd7b2

Generated at Thu Feb 08 03:50:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.