The Admin class is an internal class that allows convenient access to
the admin functionality and commands for MongoDB.
ADMIN Cannot directly be instantiated
example
constMongoClient = require('mongodb').MongoClient;consttest = require('assert');// Connection urlconsturl = 'mongodb://localhost:27017';// Database NameconstdbName = 'test';// Connect using MongoClientMongoClient.connect(url, function(err, client) {// Use the admin database for the operationconstadminDb = client.db(dbName).admin();// List all the available databasesadminDb.listDatabases(function(err, dbs) {expect(err).to.not.exist;test.ok(dbs.databases.length > 0);client.close(); });});
The Admin class is an internal class that allows convenient access to the admin functionality and commands for MongoDB.
ADMIN Cannot directly be instantiated