On 02/20/2013 01:42 AM, Volker Mische wrote:
I think it does address indexes. Only the JavaScript engine will deal
with the encoding/decoding. AFAIK SpiderMonkey/V8 doeas the right thing.
I did a quick check:
lmorandini@vaneyck: >node
> var n= {"n": 17.3};
undefined
> console.log(n.n);
17.3
> 17.0 + 0.3
17.3
Right!
...but:
function(doc) {
emit(doc._id, [17.3, 17.0 + 0.3]);
}
lmorandini@vaneyck: >curl -X GET
http://localhost:5984/datastore/_design/main/_view/numbertest
{"total_rows":12,"offset":0,"rows":[
{"id":"a0046a217ccabb616007fce0980008c6","key":"a0046a217ccabb616007fce0980008c6","value":[17.300000000000000711,17.300000000000000711]},
...
Wrong!
Therefore, I would argue this is not a feature intrinsic to JSON or JavaScript.
I appreciate suggestions from other members of the list, but changing numbers to
integers or multiplying them (essentially the same suggestion) is not an option,
since I have little control over input data, and it will kill performance too (I
deal mainly with geo-spatial data, hence heaps of numbers in arrays of arrays).
Well, there it goes my academic track paper on CouchDB and GeoCouch for FOSS4G
'13 :(
Regards,
Luca Morandini
Data Architect - AURIN project
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini