Skip to content

Commit

Permalink
subscription: add cloning step
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Aug 20, 2013
1 parent 77d3f1a commit 7746423
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions subscription.js
Expand Up @@ -6,6 +6,7 @@
var EventEmitter = require('events').EventEmitter;
var redis = require('redis').createClient;
var minify = require('mongo-minify');
var clone = require('clone-component');
var debug = require('debug')('mydb:subscription');

/**
Expand Down Expand Up @@ -99,6 +100,7 @@ Subscription.prototype.op = function(fn){

Subscription.prototype.onpacket = function(obj){
// minify query based on subscription fields restrictions
obj = clone(obj);
var qry = minify(obj[1], this.fields);

if (Object.keys(qry).length) {
Expand Down

0 comments on commit 7746423

Please sign in to comment.