@literacyplanet/dynamo_scan
Calls the aws-sdk's scan at a given throttle and calls an iterator function in parallel (max == throttle).
Last updated 5 years ago by literacyplanet .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @literacyplanet/dynamo_scan 
SYNC missed versions from official npm registry.

Dynamo Scan

Calls the aws-sdk's scan at a given throttle and calls an iterator function in parallel (max == throttle).

Build Status

#Setup

The following environment variables must be set:

DYNAMO_REGION
DYNAMO_TABLE

scan(attributes, limit, ExclusiveStartKey, callback);

Returns limit number of rows from dynamo. If ExclusiveStartKey is set, it will start from that row.

    var db = require('dynamo_scan');

    db.scan('user_id', 5, null, function(err, items, LastEvaluatedKey)         
        cb();
    });

scanAll(attributes, throttle, iterator, done);

The iterator function will be called in parallel up to throttle until all items have been iterated.

    var db = require('dynamo_scan');

    db.scanAll('user_id', 5, function iterator(rows, cb) { 
        cb();
    }, function finished() { 
        console.log('done', arguments) 
    });

Current Tags

  • 1.0.5                                ...           latest (5 years ago)

6 Versions

  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 6
Last Month 10
Dependencies (2)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |