Technology Encyclopedia Home >How to view MongoDB instance details?

How to view MongoDB instance details?

To view MongoDB instance details, you can use the following methods:

  1. MongoDB Shell (mongosh):
    Connect to your MongoDB instance using the mongosh command-line tool. Once connected, run the db.stats() command to view database-level statistics or db.serverStatus() for server-level details.

    Example:

    mongosh "mongodb://username:password@host:port/database"
    > db.stats()
    > db.serverStatus()
    
  2. MongoDB Compass (GUI Tool):
    MongoDB Compass provides a graphical interface to view instance details, including collections, indexes, performance metrics, and server status.

    Example:

    • Open MongoDB Compass and connect to your instance using the connection string.
    • Navigate to the "Database" or "Collections" tab to explore details.
  3. Cloud Provider Console (e.g., Tencent Cloud):
    If your MongoDB instance is hosted on Tencent Cloud, you can view instance details through the Tencent Cloud Database for MongoDB console. The console provides metrics like CPU usage, storage, connection count, and backup status.

    Example:

    • Log in to the Tencent Cloud Console.
    • Navigate to Database > MongoDB and select your instance.
    • View details under the "Instance Details" or "Monitoring" tab.
  4. System Logs and Monitoring Tools:
    Check MongoDB logs (mongod.log) for operational details or integrate with monitoring tools like Prometheus and Grafana for advanced insights.

For Tencent Cloud users, enabling Cloud Monitor can help track performance metrics and set alerts for your MongoDB instance.