# mydb-observer **Repository Path**: mirrors_Automattic/mydb-observer ## Basic Information - **Project Name**: mydb-observer - **Description**: Observe MongoDB collections and emit events to Redis (for MyDB) - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MyDB Observer Observes MongoDB Collection objects, publishes write events to Redis for MyDB. ## Compatibility For compatible node, mongodb and redis versions, please check the `peerDependencies` field in package.json. ## Usage ```javascript "use strict"; const mongodb = require('mongodb'); const redis = require('redis'); const MyDBObserver = require('mydb-observer'); let redisClient = redis.createClient(); let observer = new MyDBObserver(redisClient); mongodb.MongoClient .connect('mongodb://localhost') .then(db => { let foo = db.collection('foo'); observer.observe(foo); // changes will be published to Redis, for MyDB foo.update(/* ... */); }); ```