Skip to content

Commit ea17d67

Browse files
author
wtao
committed
text change
1 parent d7fed8e commit ea17d67

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ there are two types of query the plugin supports, `table` or `timeserie`.
2727

2828
### query schema
2929

30-
after the frontend collects a query, it sends data of the following schema to its backend
30+
after the frontend UI collects a query, it transforms and sends data of the following schema to its backend. an example query payload to the backend can be found at [code](./sample/timeserie-query.json)
31+
3132
```javascript
3233
{
3334
collection: "collection name",
@@ -41,11 +42,11 @@ after the frontend collects a query, it sends data of the following schema to it
4142

4243
<img src="./imgs/query.png" alt="frontend" style="width: 40%;" />
4344

44-
a query is a `javascript` object.
45+
a query is a `javascript` object, NOT a `json` object.
4546

46-
the `Collection Name` field specifies the name of the collection to perform an aggregation.
47+
the `Collection Name` field, (mapped to `collection` in the above payload), specifies the name of the collection to perform an aggregation.
4748

48-
the `Aggregation Pipeline` field can have multiple aggregation steps. if you're familiar with `MongoDB Compass`, you can contruct your aggregations in the tool, then copy/paste the aggregration's `Node.js` export to the field - it's just simple as that. the supported data types are listed below.
49+
the `Aggregation Pipeline` field, (mapped to `aggregations`), can have multiple aggregation steps. if you're familiar with `MongoDB Compass`, you can contruct your aggregations in the tool, then copy/paste the aggregration's `Node.js` export to the field - it's just simple as that. the supported data types are listed below.
4950

5051
```
5152
string: "string",
@@ -62,7 +63,7 @@ the `Aggregation Pipeline` field can have multiple aggregation steps. if you're
6263

6364
- `$from`, `$to`, `$intervalMs` are grafana expandable variables for using as a time boundary and an interval
6465
- `__name`, `__value`, `__timestamp` are the plugin's internal variables to construct a named grafana timeserie data frame
65-
- an example query can be found at [code](./sample/timeserie-query.json). all 6 variables mentioned above are used. it `$group` by month and `$sum` how many movies were released during a month of a year.
66+
- in [this](./sample/timeserie-query.json) example and in its `aggregations` array, all 6 variables mentioned above are used. it `$group` by month and `$sum` how many movies were released during a month of a year.
6667

6768
## sample dashboard
6869

0 commit comments

Comments
 (0)