couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Sinclair-Day <>
Subject Re: Integers changed to float in Couch 0.11.0
Date Fri, 02 Apr 2010 14:29:39 GMT
On 4/2/10 at 1:31 AM, (Paul Davis) wrote:

>On Thu, Apr 1, 2010 at 8:15 PM, Matthew Sinclair-Day <> wrote:
>>On 4/1/10 at 7:22 PM, (J Chris Anderson) wrote:
>>> On Apr 1, 2010, at 4:14 PM, Matthew Sinclair-Day wrote:
>>>> Hi,
>>>> I have upgraded to the 0.11 release and have noticed Couch is
>>>> changing integer values into floats. 1270162450695 became
>>>> 1270162450695.0.  This is a change from the 0.10.1 release.  Is
>>>> there a way to tell Couch not to do this?
>>> You mean in the view engine. The document store will not effect data.
>>> The view engine is just JS, which has no distinction between integers and
>>> floats.
>>> I'm not sure why this would be different from the past.
>>> Chris
>>I'm accessing the document directly by its ID, not by a view.  Does this
>>still go through the view engine?  I have confirmed the JSON going into
>>couch specifies an integer, and the JSON coming out of couch has it as a
>Can you provide a small script or shell session with curl that shows
>the problem?

Sure. Here's a curl session:

curl -X POST http://localhost:5984/msdtest -d '{"num":123456789123456789}'

curl http://localhost:5984/msdtest/8d211c89d80d14972af7cb93e71754bc

In Futon, the 'num' value does not have a decimal.  I don't 
understand why there would be a difference between the curl and Futon.

It seems like the problem occurs with large numbers.  Here's 
another curl where the num is not made into a decimal:

curl -X POST http://localhost:5984/msdtest -d '{"num":123456789}'

curl http://localhost:5984/msdtest/8d211c89d80d14972af7cb93e7175daf


View raw message