 {Readable} = require 'stream'
 {EventEmitter} = require 'events'
 assert = require 'assert'
+deepEquals = require 'deep-is'
 redisLib = require 'redis'
 arraydiff = require 'arraydiff'
 ot = require './ot'

          emitter.destroy = ->
            stream.destroy()

          if !Array.isArray results
            # Results is an object. It should look like {results:[..], data:....}
            emitter.extra = results.extra
            results = results.results

          emitter.data = results


      else
        db = snapshotDb

      db.query this, cName, query, (err, resultset) =>
        if err
          callback err
        else if Array.isArray resultset
          callback null, resultset
        else
          callback null, resultset.results, resultset.extra

    # For mongo, the index is just the collection itself. For something like
    # SOLR, the index refers to the core we're actually querying.
