Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Mongoose multi-database helper/hack module
CoffeeScript
tag: 0.0.5

restored

latest commit f93ca2cfa1
@donpark authored
Failed to load latest commit information.
.gitignore initial check-in
README.md initial check-in
index.coffee restored
index.js
package.json restored

README.md

I wrote Mongeese because I couldn't figure out how to transparently access multiple MongoDB databases using Mongoose API.

Install

npm install mongeese

Usage

Replace code requiring mongoose module like this:

var mongoose = require("mongoose");
mongoose.connect(...);

with:

var mongoose = require("mongeese").create();
mongoose.connect(...);

Result of create method call should look and behave exactly like mongoose module except each result can have its own default connection.

If you need to handle multiple databases at the same time, following should suffice:

var logdb = require("mongeese").create();
var keydb = require("mongeese").create();

logdb.connect('mongodb://localhost/log');
keydb.connect('mongodb://localhost/key');

That's it.

Something went wrong with that request. Please try again.