Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongoose-database-service

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

mongoose-database-service

Promise based database logic for mongoose

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

MongooseDatabaseService

Promise wrapped database comms for mongoose

Install

npm install mongoose-database-service --save

API

var db = require('mongoose-database-service')(Model)

where Model is your Mongoose model that you want to CRUD in the database, for example:

var UserModel = mongoose.model('User', userSchema);
var db = require('mongoose-database-service')(UserModel);
Create
db.create( {} )

Passing what you want to save against your model

Update
db.update( {} )

This will merge the existing item with the new data you are passing in

Find and FindOne
db.find( {queryObject} )
db.findOne( {queryObject} )

Pass in an object as query data you want to search on

Remove
db.remove( {queryObject} )

There is plenty more to do

These cover the basics of database CRUD operations, if however you want more feel free to submit a PR

Keywords

FAQs

Package last updated on 27 Feb 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc