1.1.0 • Published 9 years ago

steeplejack-db v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Steeplejack MongoDB

Node.js Version Build Status Dependencies Dev Dependencies License

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.

1.1.0

9 years ago

1.0.0-2

9 years ago

1.0.0-1

9 years ago

1.0.0-0

9 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago