scalar bson_encode