Skip to content

Is there an issue with 64 bit numbers and CouchDB? #2919

Answered by kocolosk
ccrotty asked this question in Q&A
Discussion options

You must be logged in to vote

Yes that's right -- any number that takes a roundtrip through JavaScript (e.g. by emitting it in a view) will be converted into a double-precision floating point, which will definitely result in some corruption of integer values greater than Number.MAX_SAFE_INTEGER.

I believe you can avoid this if you're able to use the Mango system to define and query your indexes, as Mango bypasses JS altogether. But if that 64 bit integer ever ends up in JS somewhere else in your stack it will get corrupted there, too, so be careful.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ccrotty
Comment options

@popojargo
Comment options

Answer selected by wohali
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants