Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 def save_model_mongo(self, json):
     db = M.Mongo().connect()
     collection = db[ConfigManager.model_collection]
     collection.insert(json)
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 def update_model_mongo(self, json):
     db = M.Mongo().connect()
     collection = db[ConfigManager.model_collection]
     collection.update({"appId": json["appId"], "modelName": json["modelName"]}, json)
Exemplo n.º 6
0
 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()