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

mongo-watch

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongo-watch - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

2

package.json
{
"name":"mongo-watch",
"description":"A mongo watcher. This ties into the MongoDB replication oplog, and exposes all data modifications via an EventEmitter.",
"version":"0.2.6",
"version":"0.2.7",
"homepage":"http://github.com/TorchlightSoftware/mongo-watch",

@@ -6,0 +6,0 @@ "repository":"git://github.com/TorchlightSoftware/mongo-watch.git",

# Mongo Watch
This watcher ties into the MongoDB replication log (local.oplog.rs) and notifies your watchers any time the data changes.
This watcher ties into the MongoDB replication log (local.oplog.rs) by default, but you can also tie into local.oplog.$main on a master DB. It then notifies your watchers any time the data changes.
In order to use this you must:
*replication log*
1. Have access to the oplog. This will not be available on shared DB hosting, as it would reveal everyone else's database transactions to you.
2. Have replication enabled. This can be done by starting mongod with the option '--replSet someArbitraryName'. You must then call `rs.initiate()` from the mongo CLI.
2. Have replication enabled. This can be done by starting mongod with the option `--replSet someArbitraryName`. You must then call `rs.initiate()` from the mongo CLI.
*master log*
1. Have access to the oplog. This will not be available on shared DB hosting, as it would reveal everyone else's database transactions to you.
2. Start your mongod as `--master`.
3. Use: `new MongoWatch({useMasterOplog:true})`
The watcher is fairly low latency and overhead. On my machine a test with a single insert and watcher takes 20ms. The cursor used to tail the oplog is being initialized with {awaitdata: true} so the data should be getting pushed from MongoDB's internal mechanism, instead of polling.

@@ -11,0 +19,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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