You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Matthew Sinclair-Day <ms...@gmail.com> on 2010/04/02 01:14:46 UTC

Integers changed to float in Couch 0.11.0

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?

Matt


Re: Integers changed to float in Couch 0.11.0

Posted by Adam Kocoloski <ko...@apache.org>.
It's a trivial change if the community decides we don't want the mochijson2 behavior.  Do we know what their rationale was for conversion?

Adam

On Apr 12, 2010, at 5:22 PM, Zachary Zolton wrote:

> LOL... I just got bit by this as well, did anyone ever open an JIRA
> ticket on this, or shall I?
> 
> On Fri, Apr 9, 2010 at 1:54 PM, Paul Davis <pa...@gmail.com> wrote:
>> On Fri, Apr 9, 2010 at 1:13 PM, Filipe David Manana <fd...@gmail.com> wrote:
>>> On Fri, Apr 2, 2010 at 3:37 PM, Paul Davis <pa...@gmail.com>wrote:
>>> 
>>>> 
>>>> Well, there's a limit to what can be stored in an integer remember. I
>>>> wouldn't really hold my breath for anything larger than 2147483648
>>>> (2^31). The reason that Futon shows something different is because
>>>> JavaScript treats all numbers as floats and then at display time it'll
>>>> not display a fractional part if it's zero.
>>>> 
>>>> I'm suprised that it used to work. Can anyone else on 0.10 verify
>>>> that? I'm not sure if I remember anything changing in the number
>>>> handling in mochijson or not.
>>>> 
>>>> 
>>> It changed:
>>> 
>>> http://code.google.com/p/mochiweb/source/detail?r=43
>>> 
>>> JSON (and JavaScript) doesn't have a float or integer type. Everything is of
>>> type number. So anything greater than (2^31) - 1 can be represented without
>>> the decimal separator.
>>> 
>>> In JavaScript:
>>> 
>>>>>> n1 = 1270162450695
>>> 1270162450695
>>>>>> n2 = 1270162450695.0
>>> 1270162450695
>>>>>> n1 === n2
>>> true
>>> 
>>> I dunno why mochijson2 is making a distinction between integers vs floats.
>>> 
>> 
>> Oh how awesome. I have no idea why mochijson would do such a thing.
>> The only thing that's ever specified about numbers and limits is in
>> section 4 with the note "An implementation may set limits on the range
>> of numbers."
>> 
>> Blargh.
>> 
>>> 
>>> 
>>>> HTH,
>>>> Paul Davis
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Filipe David Manana,
>>> fdmanana@gmail.com
>>> 
>>> "Reasonable men adapt themselves to the world.
>>> Unreasonable men adapt the world to themselves.
>>> That's why all progress depends on unreasonable men."
>>> 
>> 


Re: Integers changed to float in Couch 0.11.0

Posted by Matthew Sinclair-Day <ms...@gmail.com>.
On 4/12/10 at 5:22 PM, zachary.zolton@gmail.com (Zachary Zolton) wrote:

> LOL... I just got bit by this as well, did anyone ever open an JIRA
> ticket on this, or shall I?

Yeah, I opened a JIRA ticket a week or so ago. 

<https://issues.apache.org/jira/browse/COUCHDB-724>

Matt


Re: Integers changed to float in Couch 0.11.0

Posted by Zachary Zolton <za...@gmail.com>.
LOL... I just got bit by this as well, did anyone ever open an JIRA
ticket on this, or shall I?

On Fri, Apr 9, 2010 at 1:54 PM, Paul Davis <pa...@gmail.com> wrote:
> On Fri, Apr 9, 2010 at 1:13 PM, Filipe David Manana <fd...@gmail.com> wrote:
>> On Fri, Apr 2, 2010 at 3:37 PM, Paul Davis <pa...@gmail.com>wrote:
>>
>>>
>>> Well, there's a limit to what can be stored in an integer remember. I
>>> wouldn't really hold my breath for anything larger than 2147483648
>>> (2^31). The reason that Futon shows something different is because
>>> JavaScript treats all numbers as floats and then at display time it'll
>>> not display a fractional part if it's zero.
>>>
>>> I'm suprised that it used to work. Can anyone else on 0.10 verify
>>> that? I'm not sure if I remember anything changing in the number
>>> handling in mochijson or not.
>>>
>>>
>> It changed:
>>
>> http://code.google.com/p/mochiweb/source/detail?r=43
>>
>> JSON (and JavaScript) doesn't have a float or integer type. Everything is of
>> type number. So anything greater than (2^31) - 1 can be represented without
>> the decimal separator.
>>
>> In JavaScript:
>>
>>>>> n1 = 1270162450695
>> 1270162450695
>>>>> n2 = 1270162450695.0
>> 1270162450695
>>>>> n1 === n2
>> true
>>
>> I dunno why mochijson2 is making a distinction between integers vs floats.
>>
>
> Oh how awesome. I have no idea why mochijson would do such a thing.
> The only thing that's ever specified about numbers and limits is in
> section 4 with the note "An implementation may set limits on the range
> of numbers."
>
> Blargh.
>
>>
>>
>>> HTH,
>>> Paul Davis
>>>
>>
>>
>>
>> --
>> Filipe David Manana,
>> fdmanana@gmail.com
>>
>> "Reasonable men adapt themselves to the world.
>> Unreasonable men adapt the world to themselves.
>> That's why all progress depends on unreasonable men."
>>
>

Re: Integers changed to float in Couch 0.11.0

Posted by Paul Davis <pa...@gmail.com>.
On Fri, Apr 9, 2010 at 1:13 PM, Filipe David Manana <fd...@gmail.com> wrote:
> On Fri, Apr 2, 2010 at 3:37 PM, Paul Davis <pa...@gmail.com>wrote:
>
>>
>> Well, there's a limit to what can be stored in an integer remember. I
>> wouldn't really hold my breath for anything larger than 2147483648
>> (2^31). The reason that Futon shows something different is because
>> JavaScript treats all numbers as floats and then at display time it'll
>> not display a fractional part if it's zero.
>>
>> I'm suprised that it used to work. Can anyone else on 0.10 verify
>> that? I'm not sure if I remember anything changing in the number
>> handling in mochijson or not.
>>
>>
> It changed:
>
> http://code.google.com/p/mochiweb/source/detail?r=43
>
> JSON (and JavaScript) doesn't have a float or integer type. Everything is of
> type number. So anything greater than (2^31) - 1 can be represented without
> the decimal separator.
>
> In JavaScript:
>
>>>> n1 = 1270162450695
> 1270162450695
>>>> n2 = 1270162450695.0
> 1270162450695
>>>> n1 === n2
> true
>
> I dunno why mochijson2 is making a distinction between integers vs floats.
>

Oh how awesome. I have no idea why mochijson would do such a thing.
The only thing that's ever specified about numbers and limits is in
section 4 with the note "An implementation may set limits on the range
of numbers."

Blargh.

>
>
>> HTH,
>> Paul Davis
>>
>
>
>
> --
> Filipe David Manana,
> fdmanana@gmail.com
>
> "Reasonable men adapt themselves to the world.
> Unreasonable men adapt the world to themselves.
> That's why all progress depends on unreasonable men."
>

Re: Integers changed to float in Couch 0.11.0

Posted by Adam Kocoloski <ko...@apache.org>.
On Apr 9, 2010, at 1:13 PM, Filipe David Manana wrote:

> On Fri, Apr 2, 2010 at 3:37 PM, Paul Davis <pa...@gmail.com>wrote:
> 
>> 
>> Well, there's a limit to what can be stored in an integer remember. I
>> wouldn't really hold my breath for anything larger than 2147483648
>> (2^31). The reason that Futon shows something different is because
>> JavaScript treats all numbers as floats and then at display time it'll
>> not display a fractional part if it's zero.
>> 
>> I'm suprised that it used to work. Can anyone else on 0.10 verify
>> that? I'm not sure if I remember anything changing in the number
>> handling in mochijson or not.
>> 
>> 
> It changed:
> 
> http://code.google.com/p/mochiweb/source/detail?r=43

Yep, at one point we had a forked mochijson2 that preserved the old behavior, but in 

http://github.com/apache/couchdb/commit/3a4fad07cb5097598eefd0cd7f588c5881a61c8f

we switched to using stock mochijson2.  Perhaps we should have been careful to preserve the old behavior?

Adam


Re: Integers changed to float in Couch 0.11.0

Posted by Filipe David Manana <fd...@gmail.com>.
On Fri, Apr 2, 2010 at 3:37 PM, Paul Davis <pa...@gmail.com>wrote:

>
> Well, there's a limit to what can be stored in an integer remember. I
> wouldn't really hold my breath for anything larger than 2147483648
> (2^31). The reason that Futon shows something different is because
> JavaScript treats all numbers as floats and then at display time it'll
> not display a fractional part if it's zero.
>
> I'm suprised that it used to work. Can anyone else on 0.10 verify
> that? I'm not sure if I remember anything changing in the number
> handling in mochijson or not.
>
>
It changed:

http://code.google.com/p/mochiweb/source/detail?r=43

JSON (and JavaScript) doesn't have a float or integer type. Everything is of
type number. So anything greater than (2^31) - 1 can be represented without
the decimal separator.

In JavaScript:

>>> n1 = 1270162450695
1270162450695
>>> n2 = 1270162450695.0
1270162450695
>>> n1 === n2
true

I dunno why mochijson2 is making a distinction between integers vs floats.



> HTH,
> Paul Davis
>



-- 
Filipe David Manana,
fdmanana@gmail.com

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."

Re: Integers changed to float in Couch 0.11.0

Posted by Matthew Sinclair-Day <ms...@gmail.com>.
On 4/2/10 at 10:37 AM, paul.joseph.davis@gmail.com (Paul Davis) wrote:

>On Fri, Apr 2, 2010 at 10:29 AM, Matthew Sinclair-Day <ms...@gmail.com> wrote:
>>On 4/2/10 at 1:31 AM, paul.joseph.davis@gmail.com (Paul Davis) wrote:
>>
>>> On Thu, Apr 1, 2010 at 8:15 PM, Matthew Sinclair-Day <ms...@gmail.com>
>>> wrote:
>>>>
>>>> On 4/1/10 at 7:22 PM, jchris@gmail.com (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
>>>> float.
>>>>
>>>> Matt
>>>>
>>>>
>>>
>>> Can you provide a small script or shell session with curl that shows
>>> the problem?
>>>
>>> Paul
>>
>>Sure. Here's a curl session:
>>
>>curl -X POST http://localhost:5984/msdtest -d '{"num":123456789123456789}'
>>{"ok":true,"id":"8d211c89d80d14972af7cb93e71754bc","rev":"1-fce9e6cc4e72866f75aeadbaed1a65c9"}
>>
>>curl http://localhost:5984/msdtest/8d211c89d80d14972af7cb93e71754bc
>>
>{"_id":"8d211c89d80d14972af7cb93e71754bc","_rev":"1-fce9e6cc4e72866f75aeadbaed1a65c9","num":
>123456789123456780.0}
>>
>>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}'
>>{"ok":true,"id":"8d211c89d80d14972af7cb93e7175daf","rev":"1-039a59b36e40b4216eac91872eed4645"}
>>
>>curl http://localhost:5984/msdtest/8d211c89d80d14972af7cb93e7175daf
>>
>{"_id":"8d211c89d80d14972af7cb93e7175daf","_rev":"1-039a59b36e40b4216eac91872eed4645","num":
>123456789}
>>
>>Matt
>>
>>
>
>Well, there's a limit to what can be stored in an integer remember. I
>wouldn't really hold my breath for anything larger than 2147483648
>(2^31). The reason that Futon shows something different is because
>JavaScript treats all numbers as floats and then at display time it'll
>not display a fractional part if it's zero.
>
>I'm suprised that it used to work. Can anyone else on 0.10 verify
>that? I'm not sure if I remember anything changing in the number
>handling in mochijson or not.
>
>HTH,
>Paul Davis

Here's a session from 0.10.1 I just ran:

curl -X POST http://localhost:5984/msdtest -d '{"num":123456789123456789}'
{"ok":true,"id":"fcd6d8fca421023581a608758a0abe35","rev":"1-fce9e6cc4e72866f75aeadbaed1a65c9"}

curl http://localhost:5984/msdtest/fcd6d8fca421023581a608758a0abe35
{"_id":"fcd6d8fca421023581a608758a0abe35","_rev":"1-fce9e6cc4e72866f75aeadbaed1a65c9","num":123456789123456789}

At any rate, I will work around this on my end.

Matt


Re: Integers changed to float in Couch 0.11.0

Posted by Paul Davis <pa...@gmail.com>.
On Fri, Apr 2, 2010 at 10:29 AM, Matthew Sinclair-Day <ms...@gmail.com> wrote:
> On 4/2/10 at 1:31 AM, paul.joseph.davis@gmail.com (Paul Davis) wrote:
>
>> On Thu, Apr 1, 2010 at 8:15 PM, Matthew Sinclair-Day <ms...@gmail.com>
>> wrote:
>>>
>>> On 4/1/10 at 7:22 PM, jchris@gmail.com (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
>>> float.
>>>
>>> Matt
>>>
>>>
>>
>> Can you provide a small script or shell session with curl that shows
>> the problem?
>>
>> Paul
>
> Sure. Here's a curl session:
>
> curl -X POST http://localhost:5984/msdtest -d '{"num":123456789123456789}'
> {"ok":true,"id":"8d211c89d80d14972af7cb93e71754bc","rev":"1-fce9e6cc4e72866f75aeadbaed1a65c9"}
>
> curl http://localhost:5984/msdtest/8d211c89d80d14972af7cb93e71754bc
> {"_id":"8d211c89d80d14972af7cb93e71754bc","_rev":"1-fce9e6cc4e72866f75aeadbaed1a65c9","num":123456789123456780.0}
>
> 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}'
> {"ok":true,"id":"8d211c89d80d14972af7cb93e7175daf","rev":"1-039a59b36e40b4216eac91872eed4645"}
>
> curl http://localhost:5984/msdtest/8d211c89d80d14972af7cb93e7175daf
> {"_id":"8d211c89d80d14972af7cb93e7175daf","_rev":"1-039a59b36e40b4216eac91872eed4645","num":123456789}
>
> Matt
>
>

Well, there's a limit to what can be stored in an integer remember. I
wouldn't really hold my breath for anything larger than 2147483648
(2^31). The reason that Futon shows something different is because
JavaScript treats all numbers as floats and then at display time it'll
not display a fractional part if it's zero.

I'm suprised that it used to work. Can anyone else on 0.10 verify
that? I'm not sure if I remember anything changing in the number
handling in mochijson or not.

HTH,
Paul Davis

Re: Integers changed to float in Couch 0.11.0

Posted by Matthew Sinclair-Day <ms...@gmail.com>.
On 4/2/10 at 1:31 AM, paul.joseph.davis@gmail.com (Paul Davis) wrote:

>On Thu, Apr 1, 2010 at 8:15 PM, Matthew Sinclair-Day <ms...@gmail.com> wrote:
>>On 4/1/10 at 7:22 PM, jchris@gmail.com (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
>>float.
>>
>>Matt
>>
>>
>
>Can you provide a small script or shell session with curl that shows
>the problem?
>
>Paul

Sure. Here's a curl session:

curl -X POST http://localhost:5984/msdtest -d '{"num":123456789123456789}'
{"ok":true,"id":"8d211c89d80d14972af7cb93e71754bc","rev":"1-fce9e6cc4e72866f75aeadbaed1a65c9"}

curl http://localhost:5984/msdtest/8d211c89d80d14972af7cb93e71754bc
{"_id":"8d211c89d80d14972af7cb93e71754bc","_rev":"1-fce9e6cc4e72866f75aeadbaed1a65c9","num":123456789123456780.0}

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}'
{"ok":true,"id":"8d211c89d80d14972af7cb93e7175daf","rev":"1-039a59b36e40b4216eac91872eed4645"}

curl http://localhost:5984/msdtest/8d211c89d80d14972af7cb93e7175daf
{"_id":"8d211c89d80d14972af7cb93e7175daf","_rev":"1-039a59b36e40b4216eac91872eed4645","num":123456789}

Matt


Re: Integers changed to float in Couch 0.11.0

Posted by Paul Davis <pa...@gmail.com>.
On Thu, Apr 1, 2010 at 8:15 PM, Matthew Sinclair-Day <ms...@gmail.com> wrote:
> On 4/1/10 at 7:22 PM, jchris@gmail.com (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
> float.
>
> Matt
>
>

Can you provide a small script or shell session with curl that shows
the problem?

Paul

Re: Integers changed to float in Couch 0.11.0

Posted by Nils Breunese <N....@vpro.nl>.
Matthew Sinclair-Day wrote:

> I have confirmed the JSON going into couch specifies an integer, and the JSON
> coming out of couch has it as a float.

 From http://json.org/ :

"A value can be a string in double quotes, or a number, or true or false
or null, or an object or an array."

AFAIK there is no concept of integer or float in JSON, it's all just
numbers.

Nils.

De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde. De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mail, noch voor tijdige ontvangst daarvan.

Re: Integers changed to float in Couch 0.11.0

Posted by Matthew Sinclair-Day <ms...@gmail.com>.
On 4/2/10 at 1:35 AM, jan@apache.org (Jan Lehnardt) wrote:

>On 2 Apr 2010, at 02:15, Matthew Sinclair-Day wrote:
>
>>On 4/1/10 at 7:22 PM, jchris@gmail.com (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 float.
>
>Can you provide a reproducible test case and create a jira ticket for this?
>
>https://issues.apache.org/jira/browse/COUCHDB
>
>Thanks a lot!
>
>Cheers
>Jan
>--
>
>

Sure. Ticket filed as <https://issues.apache.org/jira/browse/COUCHDB-724>.

Matt


Re: Integers changed to float in Couch 0.11.0

Posted by Jan Lehnardt <ja...@apache.org>.
On 2 Apr 2010, at 02:15, Matthew Sinclair-Day wrote:

> On 4/1/10 at 7:22 PM, jchris@gmail.com (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 float.

Can you provide a reproducible test case and create a jira ticket for this?

https://issues.apache.org/jira/browse/COUCHDB

Thanks a lot!

Cheers
Jan
--



Re: Integers changed to float in Couch 0.11.0

Posted by Matthew Sinclair-Day <ms...@gmail.com>.
On 4/1/10 at 7:22 PM, jchris@gmail.com (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 float.

Matt


Re: Integers changed to float in Couch 0.11.0

Posted by J Chris Anderson <jc...@gmail.com>.
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