How to use the abstract-leveldown.AbstractIterator.call function in abstract-leveldown

To help you get started, we’ve selected a few abstract-leveldown examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github No9 / node-leveldown-gap / index.js View on Github external
function ldgapIterator (db, options) {


  AbstractIterator.call(this, db)
  var emptybuffer = new Buffer(0)

  this._dbsize = this.db.container.length();
  this._reverse = !!options.reverse
  
  // Test for empty buffer in end
  if(options.end instanceof Buffer){
    if(options.end.length = 0)
      this._end = this.db.container.key(this._dbsize - 1)
  }else{  
    this._end = options.end
  }

  this._limit   = options.limit
  this._count   = 0
github Level / leveldown / iterator.js View on Github external
function Iterator (db, options) {
  AbstractIterator.call(this, db)

  this.context = binding.iterator_init(db.context, options)
  this.cache = null
  this.finished = false
}
github watson / mongodown / index.js View on Github external
var MongoIterator = function (db, options) {
  AbstractIterator.call(this, db);
  if (options.limit === 0) return;
  this._options = options;
  var query = { _id: {} };
  if (options.reverse) {
    if (options.start) query._id.$lte = options.start;
    if (options.end)   query._id.$gte = options.end;
    if (options.gt)    query._id.$lt  = options.gt;
    if (options.gte)   query._id.$lte = options.gte;
    if (options.lt)    query._id.$gt  = options.lt;
    if (options.lte)   query._id.$gte = options.lte;
  } else {
    if (options.start) query._id.$gte = options.start;
    if (options.end)   query._id.$lte = options.end;
    if (options.gt)    query._id.$gt  = options.gt;
    if (options.gte)   query._id.$gte = options.gte;
    if (options.lt)    query._id.$lt  = options.lt;
github adorsys / encrypt-down / src / index.js View on Github external
function Iterator (db, options) {
  AbstractIterator.call(this, db)
  this.codec = db.codec
  this.keys = options.keys
  this.values = options.values
  this.options = options
  this.it = db.db.iterator({ ...this.options, valueAsBuffer: false })
}
github Level / level-js / iterator.js View on Github external
function Iterator (db, location, options) {
  AbstractIterator.call(this, db)

  this._limit = options.limit
  this._count = 0
  this._callback = null
  this._cache = []
  this._completed = false
  this._aborted = false
  this._error = null
  this._transaction = null

  this._keys = options.keys
  this._values = options.values
  this._keyAsBuffer = options.keyAsBuffer
  this._valueAsBuffer = options.valueAsBuffer

  if (this._limit === 0) {
github kesla / mysqlDOWN / mysqliterator.js View on Github external
, MysqlIterator = function(db, options) {
      var self = this
        , query = []
        , start = options.start && options.start.length > 0 ? mysql.escape(options.start) : null
        , end = options.end && options.end.length > 0 ? mysql.escape(options.end) : null

      AbstractIterator.call(this, db)
      this._reverse = !!options.reverse
      this._keyAsBuffer = !!options.keyAsBuffer
      this._valueAsBuffer = !!options.valueAsBuffer

      this._stream  = new PassThrough({
          objectMode: true
      })

      this._stream.once('end', function() {
        self._endEmitted = true
      })

      query.push('SELECT * from ' + db.table)

      if (options.reverse) {
        if (start && end)
github andrewosh / hyperdown / index.js View on Github external
function HyperIterator (db, opts) {
  var checkout = db._db.snapshot()

  this._keyAsBuffer = opts.keyAsBuffer
  this._valueAsBuffer = opts.valueAsBuffer

  this.ite = checkout.lexIterator(opts)
  AbstractIterator.call(this, db)
}
inherits(HyperIterator, AbstractIterator)
github davidguttman / dynamodown / iterator.js View on Github external
var DynamoIterator = module.exports = function (db, options) {
  var self = this

  AbstractIterator.call(this, db)

  this.db = db
  this.ddb = db.ddb
  this._results = this.createReadStream(options)
  this._results.on('end', function() {
    self._endEmitted = true
  })
}
github medea / medeadown / medeaiterator.js View on Github external
, MedeaIterator = function (medea, options) {
      AbstractIterator.call(this, medea.db)

      this.keyAsBuffer = options.keyAsBuffer !== false
      this.valueAsBuffer = options.valueAsBuffer !== false

      this.keys = medea.keys.range(options)
      this.idx = 0

      this.snapshot = medea.db.createSnapshot()
    }
github DigixGlobal / truffle-lightwallet-provider / node_modules / memdown / memdown.js View on Github external
function MemIterator (db, options) {
  AbstractIterator.call(this, db)
  this._limit = options.limit

  if (this._limit === -1) this._limit = Infinity

  var tree = db._store[db._location]

  this.keyAsBuffer = options.keyAsBuffer !== false
  this.valueAsBuffer = options.valueAsBuffer !== false
  this._reverse = options.reverse
  this._options = options
  this._done = 0

  if (!this._reverse) {
    this._incr = 'next'
    this._start = ltgt.lowerBound(options)
    this._end = ltgt.upperBound(options)