DB Viewer - Mongotop
Endpoint
/o/db/mongotop
Overview
Returns a snapshot of how much time the database server spends reading and writing each collection, taken with the mongotop tool.
Authentication
Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.
Permissions
Requires a global admin user.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Conditional | Required if auth_token is not provided. |
auth_token | String | Conditional | Required if api_key is not provided. |
Examples
Read a mongotop snapshot
/o/db/mongotop?api_key=YOUR_API_KEY
Response
Success Response
[
["ns", "total", "read", "write", "2026-10-17T10:00:00Z"],
["countly.members", "0ms", "0ms", "0ms"]
]
Response Fields
| Field | Type | Description |
|---|---|---|
(root array) | Array | The output of mongotop, one array of text values per line. The first array is the header line. |
Behavior
- Runs
mongotopagainst the Countly database once and returns its first output. - The
mongotoptool must be installed on the server.
Related Endpoints
Implementation details
Database Collections
This endpoint does not read a Countly collection; it runs the mongotop tool against the database server.