Best buffer size for BSON to JSON conversion

173 views
Skip to first unread message

Jonas Schwartze

unread,
Mar 18, 2016, 1:17:26 PM3/18/16
to BSON
Hi, 
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. 
It says:

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,

Jonas

Dwight Merriman

unread,
Mar 18, 2016, 7:59:01 PM3/18/16
to bs...@googlegroups.com

On Fri, Mar 18, 2016 at 6:29 AM, Jonas Schwartze <jonassc...@gmail.com> wrote:
bson2json(bson*b, char* buffer, int size)


which library is this?

Dwight Merriman

unread,
Mar 18, 2016, 8:02:45 PM3/18/16
to bs...@googlegroups.com

On Fri, Mar 18, 2016 at 6:29 AM, Jonas Schwartze <jonassc...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "BSON" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bson+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages