jision / rock-php

Automatically exported from code.google.com/p/rock-php
0 stars 0 forks source link

Incorrect handling "Integer" data type, with mongo1.8 #122

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. You click "add new field", choose "integer", type 0, submit
2. Use another tool like MongoVUE to see the data, it shows double
3. Or you click the data field title, choose "update", then you see it 
displayed as "Float"

What is the expected output? What do you see instead?
It seems we can't add or update a field with type Integer, it always be 
float/double

What version of the product are you using?
mongo1.8
rockmongo 1.0.12

On what operating system?
Windows XP

Web server and PHP version:
The environment you provided

Please provide any additional information below.

Original issue reported on code.google.com by nowind...@gmail.com on 30 Mar 2011 at 5:11

GoogleCodeExporter commented 8 years ago
Thank you, we will check it later.

Original comment by iwind....@gmail.com on 31 Mar 2011 at 1:38

GoogleCodeExporter commented 8 years ago
maybe we should use bson data type:

http://bsonspec.org/

Original comment by iwind....@gmail.com on 31 Mar 2011 at 2:11

GoogleCodeExporter commented 8 years ago
In MongoDB, it always be double, so i changed integer and float options to 
double.

Original comment by iwind....@gmail.com on 1 Apr 2011 at 3:50

GoogleCodeExporter commented 8 years ago
The following patch addresses the issue with int/long/float support for the 
RockMongo in the following manner:
- values of type int32 are displayed as NumberInt(...)
- values of type int64 are displayed as NumberLong(...)
- values of type double are always displayed with the decimal point (e.g. 12 
will display as 12.0)

The patch adds/fixes the following parts:
- Integer / Long types are added as valid field options for New / Modify field
- JSON / array serialization works with int/long types now
- rename of int/long field doesn't change it's type to double (it was a bug 
before)

To support the int64 type, the MongoDB settings for native int64 and int64 as 
object were enabled (per http://derickrethans.nl/64bit-ints-in-mongodb.html )

Patch applies cleanly to the current SVN version.

Please review.

Thanks,
Kyryl

Original comment by kyryl.bilokurov on 9 Mar 2012 at 12:34

Attachments:

GoogleCodeExporter commented 8 years ago
A very important fix - without it the update functions corrupt the data with 
invalid values.
Is this going to be integrated in the next release?
Any reason why it wasn't part of the new v1.1.1?
Thank you.

Original comment by ar...@scene53.com on 6 May 2012 at 11:12

GoogleCodeExporter commented 8 years ago
Yes, i will integrate it into next release, if it does work.

Original comment by iwind....@gmail.com on 7 May 2012 at 6:03

GoogleCodeExporter commented 8 years ago
Kyryl Bilokurov's patch does not work on MongoDB 1.8.x, always warn:

JS Error: ReferenceError: NumberInt is not defined nofile_b:6

Original comment by iwind....@gmail.com on 7 May 2012 at 8:53

GoogleCodeExporter commented 8 years ago
Fixed in RockMongo v1.1.2  http://rockmongo.com/?action=downloads

Although there is a display bug (caused by PHP).

Original comment by iwind....@gmail.com on 7 May 2012 at 10:53