I need to store documents that have several arrays of possibly hundreds of thousands of integers to a CouchDB database. I have done some testing with node.js and the nano package by putting random numbers to arrays. I first tested by using integers with a max value of 60000 (should fit in 2 bytes) and then by using a max value of 255 (should fit in 1 byte).The document size was about two times bigger when using the larger values, so it seems that CouchDB dynamically uses memory depending on the integer value. Is this correct?
The problem is that, judging by document size, it seems that CouchDB uses two bytes when the max value is 255 and five bytes when the max value is 60000. This results to unnecessary disk space usage. Is there a way to specify that I want to use 16bit integers?