Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The $queryId is the ID string that you received when you first created the query. You can also find the queries you need by using the List Saved Queries function.

Example:

Code Block
languagephp
themeRDark
firstline1
titleCode Block Example
linenumberstrue
/* --- Method 1: Find the QueryID in the return array after saving a query --- */
//save query, returns object with unique Query ID
$res = $query->save($name, $type, $params);

//find the queryID
$queryId = $res["_id"];


/* --- Method 2: query all saved queries and choose the appropriate QueryID --- */
//Alternately, you can use $query->get() to return all saved queries
$res = $query->get();
           
//find the QueryID
$queryId = $res[0]["_id"];

$queryString (array)

The $queryString array allows you to pass dynamic values to the query, to return the results you want. When we created the query, we set variables, or placeholders, for "event", "gte" (greater than or equals), "lte" (less than or equals), and a "group".

...