docs: function doUnsubscribe(id, prop, target, conn, channels) {
    var i
      , client = conn.client
      , key
      , channel
      , ind;
  
    channels = channels.map(function(channel) {
      return '' + channel;
    })
  
    if(!channels.length) {
      channels = client.pubsub[prop];
    }
  
    for(i = 0;i < channels.length;i++) {
      key = channels[i];
      channel = target[key];
  
      // global references
      if(channel) {
        ind = channel.indexOf(client.index);
        if(~ind) {
          // remove from the list of subscribers
          channel.splice(ind, 1);
          // no more subscribers, clean up
          if(!channel.length) {
            delete target[key];
            this._count[prop].total--;
            this._stats['pubsub_' + prop]--;
          }
        }
      }
  
      // client-level references, array of patterns
      ind = client.pubsub[prop].indexOf(key);
      if(~ind) {
        client.pubsub[prop].splice(ind, 1);
        this._count[prop].subscribers--;
      }
  
      conn.write([id, key, client.pubsub[prop].length]);
    }
  
    cleanup(client);
  }