Skip to content

Instantly share code, notes, and snippets.

Avatar

iraklisg iraklisg

View GitHub Profile
@iraklisg
iraklisg / repository.js
Created Aug 10, 2017 — forked from SergeyKozachenko/repository.js
Mongoose odm and repository pattern.
View repository.js
var mongoose = require('mongoose');
var repository = function (modelName) {
var self = this;
self.Model = require('../models/' + modelName);
self.FindById = function (id, cb) {
self.FindOne({