Skip to content

Instantly share code, notes, and snippets.

@ben-ng ben-ng/gist:5026870
Last active Dec 14, 2015

Embed
What would you like to do?
Standalone models
var model = require('model');
var Adapter = require('../node_modules/model/lib/adapters/mongo').Adapter;
var User = require('../app/models/user.js').User;
var Reel = require('../app/models/reel.js').Reel;
var Video = require('../app/models/video.js').Video;
var modelAdapter = new Adapter({
dbname:config.mongo.path,
host:config.mongo.host,
port:config.mongo.port,
username:config.mongo.user,
password:config.mongo.pass,
});
model.adapters = {
'Video':modelAdapter,
'Reel':modelAdapter,
'User':modelAdapter,
};
model.Video.all(function(err,videos){
console.log(videos);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.