I'm new to CompoundJS. I'm working on a sample app. If following the below tutorial:
I have written the below code in db/schema.js file:
customSchema(function () {
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/my_database');
var Schema = mongoose.Schema, ObjectId = Schema.ObjectId;
module.exports["mongoose"] = mongoose;
module.exports["model"] = {}
});
In my model.js file (person.js), I have the code below:
var Person = mongoose.model('Person', new module.schema());
model['Person'] = Person;
When I run compound s , I'm getting ReferenceError: mongoose is not defined.
Any help would be appreciable. Thanks in advance.
Wiki is outdated, all documentation currently available at http://compoundjs.com, and i will remove wiki to avoid confusions.
You can use this example if you need mongoose as ORM: https://github.com/anatoliychakkaev/mongoose-compound-example-app