diff --git a/lib/Database.js b/lib/Database.js index 2466ea3..fc05491 100644 --- a/lib/Database.js +++ b/lib/Database.js @@ -5,6 +5,7 @@ var MongoClient = require('mongodb').MongoClient; var Model = require('./Model'); var Instance = require('./Instance'); +var _ = require('lodash'); (require.modules || {}).Database = module.exports = Database; @@ -29,6 +30,13 @@ function Database(config) { Database.Model = Model; Database.Instance = Instance; +// Add preprocessor accessors +var preprocessors = require('./preprocessors'); +for(var k in preprocessors) { + Database[k] = preprocessors[k]; +} + + Database.prototype.connect = function (cb) { /// Connects to the database server specified in the provided configuration /// A function to be called when the connection is completed, called immediately if one is already open