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

mongoose-update-if-current

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-update-if-current

Optimistic concurrency (OCC) plugin for mongoose

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.3K
decreased by-21.74%
Maintainers
1
Weekly downloads
 
Created
Source

mongoose-update-if-current

Node version Build Status Maintainability Test Coverage

Optimistic concurrency (OCC) plugin for mongoose v4.8 and higher.

Increments document version numbers on each save, and prevents previous versions of a document from being saved over a newer version.

See the __tests__ directory for examples.

Install

$ npm install --save mongoose-update-if-current

Usage

On a single schema:

import { updateIfCurrentPlugin } from 'mongoose-update-if-current';
const mongoose = require('mongoose');

const mySchema = new mongoose.Schema({ ... });
mySchema.plugin(updateIfCurrentPlugin);

Globally:

import { updateIfCurrentPlugin } from 'mongoose-update-if-current';
const mongoose = require('mongoose');

mongoose.plugin(updateIfCurrentPlugin);

Commands

npm run build          # build the library files
npm run test           # run the tests
npm run test:watch     # run the tests (watch-mode)
npm run coverage       # run the tests with coverage
npm run coverage:watch # run the tests with coverage (watch-mode)
npm run prepare           # build the library, make sure the tests passes, and then pack the library (creates .tgz)
npm run release        # prepare package for next release

License

MIT

Keywords

FAQs

Package last updated on 05 Dec 2017

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