I'm using a c library, that provides a conversion function like
void bson2json(bson*b, char* buffer, int size)
Now, what's the best buffer size? I know the size of the bson buffer, but specification is not clear about the size BSON vs. JSON.
BSON is designed to be efficient in space, but in some cases is not much more efficient than JSON.
That basically means, if the resulting JSON is smaller than the original bson I'm fine, but if not (probably most of the cases) I'm not.
Is there any (probabilistic?) rule for calculating the size of a JSON string, corresponding to a BSON buffer?
Thanks in advance,