Created
April 1, 2011 12:03
-
-
Save donpark/898040 to your computer and use it in GitHub Desktop.
stupid node.js module written in coffee-script to handle multiple Mongoose database seamlessly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoose = require('mongoose') | |
exports.create = -> | |
instance = new mongoose.Mongoose() | |
# copy over extras Mongoose users expects | |
instance.Collection = mongoose.Collection | |
instance.Connection = mongoose.Connection | |
instance.version = mongoose.version | |
instance.Mongoose = mongoose.Mongoose | |
instance.Schema = mongoose.Schema | |
instance.SchemaType = mongoose.SchemaType | |
instance.VirtualType = mongoose.VirtualType | |
instance.SchemaTypes = mongoose.SchemaTypes | |
instance.Types = mongoose.Types | |
instance.Query = mongoose.Query | |
instance.Promise = mongoose.Promise | |
instance.Model = mongoose.Model | |
instance.Document = mongoose.Document | |
instance.Error = mongoose.Error | |
instance.mongo = mongoose.mongo | |
instance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If there is a big demand for it, I'll register it as a NPM module.
Until then, here is the javascript version compiled from coffee-script: