beginner-corp / begin-data

A durable and fast key/value store for Begin built on top of DynamoDB
79 stars 8 forks source link

support for `begin` param on bulk get #91

Open lwcooper opened 3 years ago

lwcooper commented 3 years ago

Is there a way to support the begin param on a bulk get call?

This works for a single get (as per the integration tests):

let sept = await data.get({ table: 'hockey', begin: '2019-09' })

However, for a bulk get, a key is required. The following fails with the error Invalid params: all items must have table and key:

let sept = await data.get([
  { table: 'hockey', begin: '2019-09' },
  { table: 'curling', begin: '2019-09' }
])
brianleroux commented 2 years ago

interesting idea, thanks for asking, under the hood passing an array to get will call batchGet in the aws-sdk for DynamoDB which does not support query condition expressions (like begins_with) but I think it could be possible; going to try a few approaches and get back to you!