Added helper function for encoding to bson_t