It may be necessary to delete a query. In order to do so you will need to know the unique QueryID for the query to be deleted.
...
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
//Include the analytics class and the configuration class $t->runInteraction("Analytics.class.php"); $t->runInteraction("Config.class.php"); //Create our query object $query = new Query(Config::$ANALYTICS_ANALYST); //Read all saved queries $res = $query->get(); //find the queryID for the query thatQueryID you needwish to delete $queryId = $res[0]["_id"]; //delete the query, //remembering to pass in the QueryID to delete that query"56de2fr0219b38e071aac27e"; //Call the delete query function $response = $query->delete($queryId); |
Explanation:
//delete the query, remembering to pass in the queryId for the query to deleted
$response = $query->delete($queryId);
...