use BSON to encode all data.