Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disableMongo configuration for Vent-only mode #363

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Configure it via Meteor settings:
"pushToRedis": true // Pushes to redis the changes by default
},
"debug": false, // Will show timestamp and activity of redis-oplog.
"extendMongoCollection": true // Set to false to leave Mongo.Collection as is without redis-oplog functionality. Useful if you just want to use Vent.
}
}
```
Expand Down
16 changes: 16 additions & 0 deletions docs/vent.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,19 @@ Initially the server will send an .added event with an `_id: 'id'`, then the eve

We don't create any LocalCollection per subscription, as you expect, because it hooks into all the messages incomming from DDP,
does a quick check to see if it's a `vent` and calls the attached listener.

### Vent-only support

If you *only* want to use Vent from redis-oplog (and don't want
`Mongo.Collection` operations to automatically send Redis messages),
set the following in your `settings.json`:

```json
{
...
"redisOplog": {
...
extendMongoCollection: false
}
}
```
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
let Config = {
isInitialized: false,
debug: false,
overridePublishFunction: true,
extendMongoCollection: true,
mutationDefaults: {
pushToRedis: true,
optimistic: true,
Expand Down
4 changes: 3 additions & 1 deletion lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export default (config = {}) => {
oldPublish: Meteor.publish,
});

extendMongoCollection();
if (Config.extendMongoCollection) {
extendMongoCollection();
}

// this initializes the listener singleton with the proper onConnect functionality
getRedisListener({
Expand Down
1 change: 0 additions & 1 deletion testing/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if (Meteor.isServer) {
port: 6379, // Redis port
host: '127.0.0.1', // Redis host
},
// overridePublishFunction: true
// debug: true
});
}
Expand Down