[SERVER-309] fromjson modifies input int type to float Created: 23/Sep/09 Updated: 12/Jul/16 Resolved: 30/Nov/09 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | None |
| Fix Version/s: | 1.1.4 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Valentin Kuznetsov | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Tested on Mac OS X |
||
| Participants: |
| Description |
|
Using the following C++ code the input document containing int type has been modified to float. void insert(const string& host, const string& collection, const For example supplying json string " {\"test\":1}" the resulting This creates inconsistency and can lead to problem in applications who may check the types of values. It would be nice to fix it. |
| Comments |
| Comment by Mathias Stearn [ 30/Nov/09 ] |
|
The JSON parser now only creates doubles if the number has a decimal point |
| Comment by auto [ 30/Nov/09 ] |
|
Author: {'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}Message: JSON parser now creates ints and longs |
| Comment by Dominik Gehl [ 03/Nov/09 ] |
|
I came across this issue since the php driver's MongoGridFSFile::getSize function returned 0 even though the length field internally was ok ... but a float instead of an integer after I had exported/imported the gridfs data using mongoexport/mongoimport. So this issue can not only generate issues in external applications, but also more hidden ones in the language drivers for example ! |