lib/enhance/rangereader.js
function RangeReader(options) {
        RangeReader.__super__.constructor.call(this);
        this.begin = options.begin;
        this.end = options.end;
        this.marker = null;
        this.limit = options.limit;
        this.reverse = options.reverse;
        this.streamingMode = options.streamingMode;
        this.nonTransactional = options.nonTransactional || false;
        this.snapshot = options.snapshot || false;
        debug(function(writer) {
          if (options.begin) {
            writer.buffer('begin', resolveKey(options.begin).toString('utf8'));
          }
          if (options.end) {
            writer.buffer('end', resolveKey(options.end).toString('utf8'));
          }
          writer.buffer('limit', options.limit);
          writer.buffer('reverse', options.reverse);
          writer.buffer('streamingMode', options.streamingMode);
          writer.buffer('nonTransactional', options.nonTransactional);
          return writer.buffer('snapshot', options.snapshot);
        });
        this.on('data', (function(_this) {
          return function(data) {
            var kv, _i, _len;
            if (data instanceof Array) {
              for (_i = 0, _len = data.length; _i < _len; _i++) {
                kv = data[_i];
                _this.marker = kv.key;
              }
            } else {
              _this.marker = data.key;
            }
          };
        })(this));
      }
function RangeReader(options) {
        RangeReader.__super__.constructor.call(this);
        this.begin = options.begin;
        this.end = options.end;
        this.marker = null;
        this.limit = options.limit;
        this.reverse = options.reverse;
        this.streamingMode = options.streamingMode;
        this.nonTransactional = options.nonTransactional || false;
        this.snapshot = options.snapshot || false;
        debug(function(writer) {
          if (options.begin) {
            writer.buffer('begin', resolveKey(options.begin).toString('utf8'));
          }
          if (options.end) {
            writer.buffer('end', resolveKey(options.end).toString('utf8'));
          }
          writer.buffer('limit', options.limit);
          writer.buffer('reverse', options.reverse);
          writer.buffer('streamingMode', options.streamingMode);
          writer.buffer('nonTransactional', options.nonTransactional);
          return writer.buffer('snapshot', options.snapshot);
        });
        this.on('data', (function(_this) {
          return function(data) {
            var kv, _i, _len;
            if (data instanceof Array) {
              for (_i = 0, _len = data.length; _i < _len; _i++) {
                kv = data[_i];
                _this.marker = kv.key;
              }
            } else {
              _this.marker = data.key;
            }
          };
        })(this));
      }
function RangeReader ( options ) { RangeReader . __super__ . constructor . call ( this ) ; this . begin = options . begin ; this . end = options . end ; this . marker = null ; this . limit = options . limit ; this . reverse = options . reverse ; this . streamingMode = options . streamingMode ; this . nonTransactional = options . nonTransactional || false ; this . snapshot = options . snapshot || false ; debug ( function ( writer ) { if ( options . begin ) { writer . buffer ( 'begin' , resolveKey ( options . begin ) . toString ( 'utf8' ) ) ; } if ( options . end ) { writer . buffer ( 'end' , resolveKey ( options . end ) . toString ( 'utf8' ) ) ; } writer . buffer ( 'limit' , options . limit ) ; writer . buffer ( 'reverse' , options . reverse ) ; writer . buffer ( 'streamingMode' , options . streamingMode ) ; writer . buffer ( 'nonTransactional' , options . nonTransactional ) ; return writer . buffer ( 'snapshot' , options . snapshot ) ; } ) ; this . on ( 'data' , ( function ( _this ) { return function ( data ) { var kv , _i , _len ; if ( data instanceof Array ) { for ( _i = 0 , _len = data . length ; _i < _len ; _i ++ ) { kv = data [ _i ] ; _this . marker = kv . key ; } } else { _this . marker = data . key ; } } ; } ) ( this ) ) ; }
Creates a new Reader instance
@class
@param {object} options Settings.
@param {(Buffer|fdb.KeySelector)} [options.begin] First key in the reader range.
@param {(Buffer|fdb.KeySelector)}} [options.end=undefined] Last key in the reader range.
@param {number} [options.limit=undefined] Only the first limit keys (and their values) in the range will be returned.
@param {boolean} [options.reverse=undefined] Specified if the keys in the range will be returned in reverse order
@param {(iterator|want_all|small|medium|large|serial|exact)} [options.streamingMode=undefined] fdb.streamingMode property that permits the API client to customize performance tradeoff by providing extra information about how the iterator will be used.
@param {boolean} [options.nonTransactional=false] Reset transaction on expiry and start.
@param {boolean} [options.snapshot=false] Defines whether range reads should be snapshot reads.
@property {array} instances Collection of Document Layer db instances.
@property {number} index Current index of the instances collection.
@property {(Buffer|fdb.KeySelector)}} begin First key in the reader range.
@property {(Buffer|fdb.KeySelector)}} end Last key in the reader range.
@property {Buffer} marker Marker key for transaction expiration continuation point.
@property {number} limit Only the first limit keys (and their values) in the range will be returned.
@property {boolean} reverse Specified if the keys in the range will be returned in reverse order
@property {(iterator|want_all|small|medium|large|serial|exact)} streamingMode fdb.streamingMode property that permits the API client to customize performance tradeoff by providing extra information about how the iterator will be used.
@property {boolean} nonTransactional Reset transaction on expiry and start.
@property {boolean} snapshot Defines whether range reads should be snapshot reads.
@return {Reader} a Reader instance.
Creates a new Reader instance