Changing json.loads to bson to allow date queries