@theshelf/database-driver-mongodb
v0.6.0
Published
This package contains the driver implementation for MongoDB. This driver can be used by the [core package](../../core/README.md) for performing the actual operations.
Keywords
Readme
Database MongoDB driver | The Shelf
This package contains the driver implementation for MongoDB. This driver can be used by the core package for performing the actual operations.
Installation
npm install @theshelf/database @theshelf/database-driver-mongodbHow to use
The basic set up looks like this.
import Database from '@theshelf/database';
import { MongoDBDriver } from '@theshelf/database-driver-mongodb';
const driver = new MongoDBDriver({/* Configuration options */});
const database = new Database(driver);
// Perform operations with the database instanceConfiguration options
type MongoDBConfiguration = {
connectionString: string; // e.g. "mongodb://development:development@localhost:27017"
databaseName: string; // e.g. "mydb"
};