def execute(self,date_from,date_to,arguments): mongo=Mongo() dict_query=self.mongoQuery.dict_query db_name=dict_query["db_name"] coll=dict_query["coll"] level=self.mongoQuery.level #str_query=""" #return $db.group({ # key: {"Module":1}, # # cond:{"LogLevel":"error","Method": "HoldSeats"}, # # reduce: function ( curr, result ) {result.total += 1;}, # # initial:{ total : 0 } # # }); # """ str_query=dict_query["str_query"] print len(arguments) if self.mongoQuery.args_count != len(arguments): raise Exception("Console Error: Invalid No of arguments!") return mongo.query(db_name,date_from,date_to,str_query,arguments,coll)
def execute_str(str_query,db_name,date_from,date_to,coll,arguments): mongo=Mongo() return mongo.query(db_name,date_from,date_to,str_query,arguments,coll)