[SERVER-9973] NumberLong(NumberLong(1)) throws error: Could not convert "NumberLong(1)" to NumberLong Created: 20/Jun/13  Updated: 19/Sep/15  Resolved: 31/Jul/15

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: 2.4.2
Fix Version/s: 3.1.7

Type: Bug Priority: Minor - P4
Reporter: Declan McGrath Assignee: Jonathan Reams
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 12.10


Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

In the mongodb shell run NumberLong(NumberLong(1))

Sprint: Build 7 08/10/15
Participants:

 Description   

Whereas NumberInt(NumberInt(1)) does not.

Workaround using parseInt

  • NumberLong(parseInt(value, 10))


 Comments   
Comment by Githook User [ 31/Jul/15 ]

Author:

{u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}

Message: SERVER-9973 Fix NumberLong on 32-bit platforms
Branch: master
https://github.com/mongodb/mongo/commit/157475b5b057d54440f97d144a551f5c16c70501

Comment by Githook User [ 30/Jul/15 ]

Author:

{u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}

Message: SERVER-9973 Allow creating NumberLong from anything that supports toNumber
Branch: master
https://github.com/mongodb/mongo/commit/776125821c0eb2212d509ab1e52dc2139c495963

Comment by Ramon Fernandez Marina [ 24/Jul/15 ]

Thanks for filing this ticket theirishpenguin, a fix is in the wish-list for the current development cycle.

Cheers,
Ramón.

Comment by Declan McGrath [ 20/Jun/13 ]

Other workaround using Number is NumberLong(Number(NumberLong(1)))

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