Debug for decoding and encoding bson