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.
Updating a query:
Code Block Example
//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 that you need to delete $queryId = $res[0]["_id"]; //delete the query, //remembering to pass in the QueryID to delete that query $response = $query->delete($queryId);
Explanation:
//delete the query, remembering to pass in the queryId for the query to deleted
$response = $query->delete($queryId);
Delete the query, remembering to pass in the correct QueryID.
$queryId (string)
This is the Query ID of the query you wish to delete.
Please see List (Read) Saved Queries for more information
Return:
If the delete was successful the response would be TRUE. If you try to delete a query that does not exist,
Return
//If delete was successful 1 //If delete was unsuccessful