[SERVER-32784] Add $convert with support for typecasting between numeric types Created: 18/Jan/18  Updated: 30/Oct/23  Resolved: 20/Feb/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.7.3

Type: New Feature Priority: Major - P3
Reporter: Justin Seyster Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-11386 Add $convert with support for typecas... Closed
Duplicate
is duplicated by SERVER-5239 $project should have numeric type coe... Closed
Backwards Compatibility: Minor Change
Sprint: Query 2018-01-29, Query 2018-02-12, Query 2018-02-26
Participants:
Case:

 Comments   
Comment by Ankit Rathore [ 04/Apr/18 ]

is there any work around for this in the current mongo version 3.6 , till this fix released. i am struggling with this issue . Any help will be much appreciated. i need to select converted integer value from a string in '$project' stage and i have to compare this value in '$match' stage for $gt and $lt comparison.

for example
db.employee.aggregate(
{$project: {empID:

{'$toInt' : '$id'}

, empName:'$name'},
{$match:{ empID:

{'$gt':100}

}}
)

Comment by Githook User [ 20/Feb/18 ]

Author:

{'email': 'justin.seyster@mongodb.com', 'name': 'Justin Seyster', 'username': 'jseyster'}

Message: SERVER-32784 Move ExpressionConvert tests to separate file.
Branch: master
https://github.com/mongodb/mongo/commit/46b28bb7bce583a72bb80e51f8e89f98bb03af21

Comment by Githook User [ 15/Feb/18 ]

Author:

{'email': 'justin.seyster@mongodb.com', 'name': 'Justin Seyster', 'username': 'jseyster'}

Message: SERVER-32784 Add $convert with typecast conversions.
Branch: master
https://github.com/mongodb/mongo/commit/3fe0f3a0623972814edd101436d940182937223e

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