Closed yanakend closed 9 years ago
Npdynamodb does not support batchGetItem recently but I'm considering new interface for it. And it may be included next release.
So now, using raw dynamodb client through rawClient
method is better.
npd().rawClient().batchGetItem(opts).then(function(result){
console.log(result);
});
Considering syntax both of QueryBuilder and Orm are following.
// Querybuilder
npd().table('foo_table').whereIn('hash_key', [1, 2, 3]).then(function(result){
console.log(result); // result is raw response from dynamodb.
});
// Orm
Foo.query(function(qb){
qb.whereIn('hash_key', [1, 2, 3]);
}).fetch().then(function(fooCollection){
fooCollection.each(function(fooModel){
console.log(fooModel.get(name));
});
});
Original batchGetItem operation can take items from multiple tables, but Npdynamodb does not take items from multiple tables cause it will be occurred impedance mismatch.
Thanks.
I'm using this driver recently, it's very nice. I wanna get multiple items using multiple primary keys at once. How can I get it?
Currently, I wrote like below..(of course slow)