New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

simple-mongoose-controller

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-mongoose-controller

A simple controller for mongoose models

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

README

This module provides a very simple controller for mongoose models.

How to use

#!Node.js

var Controller = require('simple-mongoose-controller');
var model = // some Mongoose Model

var controller = new Controller(model);

// Get all documents of this model:
controller.getAll(callback);

// Get a document by its id:
controller.getById(id, done);

// Create a new document:
controller.create(data, done);

// Update existing document:
controller.update(id, data, done);

// Delete a document:
controller.delete(id, done);

done is a callback function that uses the error first pattern. Also the controller methods return promises that you can use instead of the callback methods.

FAQs

Package last updated on 03 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts