1.1.0 • Published 9 years ago
steeplejack-db v1.1.0
Steeplejack MongoDB
MongoDB implementation for steeplejack projects
Usage
This is a very thin wrapper for the MongoDB MongoClient.connect. It configures an instance of the MongoDB driver wrapped in generic-pool class for easy connection pooling.
This configures a Steeplejack injectable module called $mongodbDriver
.
// Configure a factory dependency
export let __factory = {
name: "$mongodbResource",
factory: ($mongodbDriver) => {
let poolOptions = {};
let mongoOptions = {};
let mongoUrl = "mongodb://localhost/db";
return $mongodbDriver({
url: mongoUrl,
poolOptions,
mongoOptions
});
}
};
The poolOptions
accepts anything that the generic-pool
takes.
The mongoOptions
accepts anything that the
MongoClient.connect options take.