Skip to main content

GetItem

Store.get()

Create a get query.

import { DynamoDBClient } from '@aws-cdk/client-dynamodb'
import { Store } from '@declanprice/dynostore'

const store = new Store('CustomerTable', new DynamoDBClient())

const request = store.get<CustomerItem>();

key(key)

Provide the item key to get.

request.key({id: '1' });

consistent()

Require strongly consistent reads.

request.consistent();

projection(projectionString)

Project specific fields to be returned.

request.project('id,fistName,lastName');

exec()

Execute the request.

const customer = await request.exec();

tx()

Create a TransactGetItem.

const customerTxItem = request.tx();