hapijs/catbox-mongodb — pull request #8 by jardakotesovec (2014-09-10 19:29:47+00:00)
Title: Value conversion by MongoDB driver instead of JSON

Is there good reason to use JSON.stringify?

I see advantages in using MongoDB driver conversion.

It handles more data types, here is the conversion list [MongoDB driver docs](http://mongodb.github.io/node-mongodb-native/api-articles/nodekoarticle1.html?highlight=error%20object). Some of them are very handy, like dates or binary data.

Also it should perform faster. MongoDB reads BSON from drive (or memory) and directly sends this BSON to client and mongo driver build JS objects. Parsing BSON should be faster (assuming good implementation), but I do not have proof for that :-).

Maybe I don't see some obvious reason, why its bad idea. Only issue I can think of at the moment is that if someone use catbox with mongodb and than switch to other backend (like redis) it will throw errors on some data types that MongoDB handled, which might be unexpected.

Thank you for any feedback.