Methods for storing small integers in MongoDB -
i'm trying optimize db size collection contains lot of documents. documents have number of properties represented small integers (< 255). in sql server world these stored tinyint values, smallest bson type can find int32.
are there alternatives efficiently storing small integers in mongodb?
tinyint
data type equal byte
(-256 < byte < 255) , smallint
int16
.
but mongodb stores data in binary format called bson supports these numeric data types:
- int32 - 4 bytes (32-bit signed integer)
- int64 - 8 bytes (64-bit signed integer)
- double - 8 bytes (64-bit ieee 754 floating point)
reference:
Comments
Post a Comment