@iwsio/mongo-repo-node

3.2.0 • Public • Published

Simple MongoDb Wrapper (LEGACY)

Run tests

This is a really old, thin wrapper around the native mongoDB driver (originally v2) to support some repository-style use-cases. The idea was to allow "models" and "collections" to be defined with pre-existing funcionality and those models be instantiated when enumerating a collection result.

This first version will just be a placeholder while we get projects updated to more recent versions of MongoDb Driver.

Included Helpers

  • find - function({query}, callback) callback returns array of documents
  • findOne - function({query}, callback) callback returns matching document
  • findById - function(_id, callback) callback returns document
  • findAndModify - function({query}, [sort], {update}, {options}, callback) - native passthrough
  • insert - function({data}, callback) callback returns inserted document; assuming one doc
  • update - function({data}, callback) native passthrough
  • upsert - function({data}, callback) native passthrough
  • removeById - function(_id, callback) native passthrough
  • remove - function({query}, callback) native passthrough
  • count - function({query}, callback) native passthrough
  • aggregate - function({query}, callback) native passthrough

Dependencies (2)

Dev Dependencies (10)

Package Sidebar

Install

npm i @iwsio/mongo-repo-node

Weekly Downloads

0

Version

3.2.0

License

BSD-3-Clause

Unpacked Size

9.42 kB

Total Files

7

Last publish

Collaborators

  • iwsllc