code: function (notification, trigger) {
      // Most notifications that use the crossbar have a string `collection` and
      // maybe an `id` that is a string or ObjectID. We're already dividing up
      // triggers by collection, but let's fast-track "nope, different ID" (and
      // avoid the overly generic EJSON.equals). This makes a noticeable
      // performance difference; see https://github.com/meteor/meteor/pull/3697
      if (typeof(notification.id) === 'string' &&
          typeof(trigger.id) === 'string' &&
          notification.id !== trigger.id) {
        return false;
      }
      if (notification.id instanceof MongoID.ObjectID &&
          trigger.id instanceof MongoID.ObjectID &&
          ! notification.id.equals(trigger.id)) {
        return false;
      }
  
      return _.all(trigger, function (triggerValue, key) {
        return !_.has(notification, key) ||
          EJSON.equals(triggerValue, notification[key]);
      });
    }
docs: A notification matches a trigger if all keys that exist in both are equal.  Examples: N:{collection: "C"} matches T:{collection: "C"} (a non-targeted write to a collection matches a non-targeted query) N:{collection: "C", id: "X"} matches T:{collection: "C"} (a targeted write to a collection matches a non-targeted query) N:{collection: "C"} matches T:{collection: "C", id: "X"} (a non-targeted write to a collection matches a targeted query) N:{collection: "C", id: "X"} matches T:{collection: "C", id: "X"} (a targeted write to a collection matches a targeted query targeted at the same document) N:{collection: "C", id: "X"} does not match T:{collection: "C", id: "Y"} (a targeted write to a collection does not match a targeted query targeted at a different document)