Skip to content

Instantly share code, notes, and snippets.

View iraklisg's full-sized avatar

iraklisg iraklisg

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