Create Metric

Data structure

The analytics data for metrics you created are always generated on run-time. Each metric consist of:

  • Collection name (e.g. Users)
  • Date object on your collection items (e.g. createdAt) we use to generate graphs you see on your dashboard, to help you analyze data in selected period of time
  • Query or Aggregation (e.g. {verified: true}) we use to define your metric
  • Metric name (e.g. Verified users) to help you navigate between metric

Verified Users example preview

Each metric is a simple {query} or [aggregate] to get the count in the selected period of time.

The example mentioned above would result in the metric named Verified users.

db.getCollection('users').find({ createdAt: { $gte: 'FROM_DATE', $lte: 'TO_DATE' }, verified: true })