optimization on JSON <-> BSON convertion

Signed-off-by: naazgull <pedro.figueiredo@gmail.com>