def from_mongo(query): mongo_data = Database.find_one_data(collection='books', query={'isbn': int(query)}) if mongo_data == None: return None else: return dict(mongo_data)
def get_user_mongo(query): mongo_user = Database.find_one_data(collection='users', query={'user_id': query}) return mongo_user