The console is powered primarily by stored and reusable MongoDB queries, which requires some familiarity with JSON and the way Mongoose databases are queried.
The default queries view will list the query name and it's type, and some simple create/edit/delete options.
Writing mongo queries for the first time can be quite intimidating - luckily however, the analytics console provides the query playground, for users to build out and test their own custom queries.
Query Playground
The query playground will let you choose from your project queries to run over the collector you'll select just afterwards. Users will then be prompted to fill in the values required by the query, before being able to execute it. This emulates how a query would be set up within the dashboard, and is extremely helpful for testing and prototyping purposes.
...
...
...
...
...
Now your query is created, if you return to the playground and select it, a new blue box titled Search Parameters will appear below the query box. You'll see here it's asking for the value of n.
here, we need to pass in the value type, followed by the value. We want to see the last X number of events, so we we need to tell it that it's an integer, and what it's value is.
here, we'll pass in int:2.
This tells the query that the value is an integer, and the integer is 2.
Before you can run this, you need to select the collector that you wish query. You can read all about how collectors work here.
Hit apply, and watch what happens next.
...
language | js |
---|
...