Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Admin

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
import { MongoClient } from 'mongodb';

const client = new MongoClient('mongodb://localhost:27017');
const admin = client.db().admin();
const dbInfo = await admin.listDatabases();
for (const db of dbInfo.databases) {
console.log(db.name);
}

Hierarchy

  • Admin

Index

Methods

Generated using TypeDoc