Mongoose Builder
Overview
Convenience library for building Mongoose schemas and models, and working with connections
Usage
Install:
npm install easy-mongoose
To create a schema:
var typeBuilder = typeBuilder; // Specify a namespace for the schemasvar schemas = typeBuilder; schemas // Create two schema elements, "adult" and "child" 'child' name: type: String required: true unique: true description: String 'adult' name: type: String required: true unique: true children: schemas // Export "adult" as a model element, but not "child" 'adult';
Then to consume those schemas as models:
var dbConnection = dbConnection; ;