Convert dict to bson