4

I tracked down this package. Generally it's pretty nice. But it seems to lack support for Projection Expressions. What is your tool of choice for dynamodb in node/typescript?

I'm not fan of the data mappers listed here because they tend to wrap the table data, or are abandoned as projects.

Daniel Birowsky Popeski
  • 8,752
  • 12
  • 60
  • 125

3 Answers3

2

If typescript is an option, we use https://github.com/shiftcode/dynamo-easy. Which also does not support Projection Expression, but the underlying params can always be accessed and manipulated, so adding some non-supported feature is easy.

import { DynamoStore } from '@shiftcoders/dynamo-easy'

const queryRequest = new DynamoStore(PersonModel)
    .query()
    .wherePartitionKey('2018-01')
    .whereSortKey().beginsWith('a')
    .limit(1)

    const queryParams = queryRequest.params
    queryParams.ProjectionExpression = 'projectionExpression'
    // also add expression attribute names if required
    queryParams.ExpressionAttributeNames = {'#someExpressionAttributeName': 'someExpressionAttributeName'}

    // you can also use new DynamoDB().query(queryParams), but we just use the preconfigured wrapped client  
    queryRequest.dynamoDBWrapper.makeRequest('query', queryParams)
        .then(r => console.log('first found item with projection expression:', r))

full disclosure: I am one of the authors of this library

Community
  • 1
  • 1
wittwermic
  • 198
  • 2
  • 10
1

We use dynogels, it is maintained until to date.

https://github.com/clarkie/dynogels

Kannaiyan
  • 12,554
  • 3
  • 44
  • 83
0

If you need a GUI to construct your query, try using the "DynamoDB Visual Query Builder" I've built: https://dynobase.dev/dynamodb-query-builder/

Rafal Wiliński
  • 2,240
  • 1
  • 21
  • 26