def get_model_mongo_byAppId(self, model_params): db = M.Mongo().connect() collection = db[ConfigManager.model_collection] model_Cursor = collection.find({"appId": model_params['appId']}) return model_Cursor
def save_model_mongo(self, json): db = M.Mongo().connect() collection = db[ConfigManager.model_collection] collection.insert(json)
def delete_model_mongo(self, json): db = M.Mongo().connect() collection = db[ConfigManager.model_collection] status = collection.remove({"appId": json["appId"], "modelName": json["modelName"]}) return status
def update_key_mongo(self, appId, modelName, status): db = M.Mongo().connect() collection = db[ConfigManager.model_collection] collection.update({"appId": appId, "modelName": modelName}, {"$set": status}, True)
def update_model_mongo(self, json): db = M.Mongo().connect() collection = db[ConfigManager.model_collection] collection.update({"appId": json["appId"], "modelName": json["modelName"]}, json)
def get_model_mongo_byAppIdandmodelName_count(self, model_params): db = M.Mongo().connect() collection = db[ConfigManager.model_collection] model_json = collection.find({"appId": model_params['appId'], "modelName": model_params['modelName']}) return model_json.count()