1.1.1 • Published 11 years ago

mongorepository v1.1.1

Weekly downloads
3
License
-
Repository
-
Last release
11 years ago

mongorespository

A node.js module that contains a generic implementation of the Repository Pattern for mongoDB.

Installation

The easiest way to install is through the Node Package Manager (NPM):

npm install mongorepository

Usage

//reference the repository object
var Repository = require('mongoRepository').Repository;

//create an instance
var catRepository = new Repository('username:password@localhost/dbname', 'cat');

var cat = {
  name: 'trevor'
}
//add cat
catRepository.add(cat);

//find cat
query = {name: 'trevor'}
catRepository.find(query, function(results){
  console.log(results);
});

//update cat
cat.age = 4;
catRepository.update(query, cat);

//delete cat
catRepository.remove(query);
1.1.1

11 years ago

1.1.0

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago

1.0.0

12 years ago