@creately/mungo

Javascript implementation of MongoDB update operators.

Stats

StarsIssuesVersionUpdatedCreatedSize
@creately/mungo
1.3.03 years ago4 years agoMinified + gzip package size for @creately/mungo in KB

Readme

mungo

Javascript implementation of MongoDB update operators.

Getting Started

Install the package

npm install @creately/mungo

Import the modify function from mungo and call it with the document.

import { modify } from 'mungo'

const doc = { id: 'id', x: 10 }
modify(doc, { $set: { x: 20 } })

console.log(doc)
// { id: 'id', x: 20 }

Supported Operators

Field Update Operators

  • $set

Array Update Operators

  • $push
  • $pull

Bitwise Update Operators

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.