Dictionary working for JSON and BSON