def execute(self):
if self.query_set_obj is None:<EOL><INDENT>return []<EOL><DEDENT>if self.is_mongoengine:<EOL><INDENT>result = self.query_set_obj.aggregate(*self.get_query())<EOL><DEDENT>else:<EOL><INDENT>result = self.query_set_obj.aggregate(self.get_query())<EOL><DEDENT>if IS_PYMONGO_3:<EOL><INDENT>result = list(result)<EOL><DEDENT>else:<EOL><INDENT>result = result.get('<STR_LIT:result>')<EOL><DEDENT>if result:<EOL><INDENT>return result<EOL><DEDENT>return []<EOL>
Executes the query if self.query_set_obj is set
:return: The result of aggregation query