Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 19540 invoked from network); 22 Mar 2009 22:24:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Mar 2009 22:24:00 -0000 Received: (qmail 9693 invoked by uid 500); 22 Mar 2009 22:23:59 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 9611 invoked by uid 500); 22 Mar 2009 22:23:59 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 9601 invoked by uid 99); 22 Mar 2009 22:23:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Mar 2009 22:23:59 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcdcu-couchdb-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Mar 2009 22:23:50 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LlW4g-0007PI-6i for user@couchdb.apache.org; Sun, 22 Mar 2009 22:23:22 +0000 Received: from d75-155-96-24.bchsia.telus.net ([75.155.96.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 22 Mar 2009 22:23:22 +0000 Received: from lists by d75-155-96-24.bchsia.telus.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 22 Mar 2009 22:23:22 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: user@couchdb.apache.org From: Daniel Friesen Subject: Re: json/couchdb integer min max values Date: Sun, 22 Mar 2009 15:23:08 -0700 Lines: 44 Message-ID: References: <49C6B67A.50403@michevan.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: d75-155-96-24.bchsia.telus.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 ThunderBrowse/3.2.1.9 Mnenhy/0.7.5.666 In-Reply-To: Sender: news X-Virus-Checked: Checked by ClamAV on apache.org The easiest way to check should just be to throw a few documents with really large numbers in them. Also do some views, I think the real issue will be the standard floating point number limitation inside of JavaScript. If you have numbers that are too large, the catch all way to handle that would probably be to use a string instead and left 0 pad numbers. Though you could probably do that inside of a view itself. ~Daniel Friesen (Dantman, Nadir-Seen-Fire) Paul Davis wrote: > IIRC, the JSON RFC either doesn't mention limits whatsoever or only > mentions that there is no limit. > > A quick glance at mochijson2.erl which is CouchDB's JSON decoder looks > like its using list_to_integer for its conversion routine. The docs at > [1] on list_to_integer don't mention limits. I'm not at all certain, > but I think that erlang has builtin large number support so it may > Just Work ™. But tracking down any caveats on list_to_integer/1 > should give you what you need. > > HTH, > Paul Davis > > [1] http://erlang.org/doc/man/erlang.html > > On Sun, Mar 22, 2009 at 6:06 PM, Evan McLean wrote: > >> Is it documented anywhere what the minimum and maximum values for an int >> are in couchdb and/or json? >> >> Based on a 32 bit integer? >> >> I had a quick scan through the json RFC and couldn't find anything. >> >> How would you go about efficiently handling very large numbers, >> especially if you wanted to use them in (sorted) keys? >> >> E. >> >> > >