mongo-changestream-connector
## Description Connect and change streams with Mongoose
Last updated 2 years ago by midnightp .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mongo-changestream-connector 
SYNC missed versions from official npm registry.

Mongo Changestream Connector

Description

Connect and change streams with Mongoose

This module is created for Mongo Live Server

How to install

This module depends on mongodb. If you're using Mongoose, and you want to create Mongoose connections instead of native MongoDB connections, e.g. to instantiate your Mongoose models with, mongoose@5 is a peer dependency of this module. So, make sure that Mongoose version 5 is installed in your project.

npm i mongo-changestream-connector

Or when using yarn:

yarn add mongo-changestream-connector

How to use

Supply the setting useMongoose: true to the Connector constructor.

Now, after using the mongoose connection to instantiate models, you can access all mongoose models with Connector.models. The reference to the native MongoDB with Connector.db will now not be available anymore.

Finally, instead of specifying collectionName in the changeStream method, specify modelName.

Convenience variables:

When using Mongoose

connector.models

When using MongoDB

MongoClient connector.mongoClient = client

Db Instance the return value of mongoClient.db() connector.db

How to contribute

Release

  • Run npm run release-test to make sure that everything is ready and correct for publication on NPM.
  • If the previous step succeeded, release a new master version with a raised version tag following the git flow standard.
  • Run npm run release to finally publish the module on NPM.

How to test

Run all the tests once with coverage:

npm test

Run all the tests without coverage and with a watch:

npm tests

Run the MongoDB tests without coverage and with a watch:

npm test-mongo

Run the Mongoose tests without coverage and with a watch:

npm test-mongoose

Current Tags

  • 1.3.1                                ...           latest (2 years ago)

10 Versions

  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.3                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (8)
Dev Dependencies (7)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |