object conversion to bson