-
Notifications
You must be signed in to change notification settings - Fork 114
Description
π¨ π¨ Hey folks, I'm mostly creating this to raise awareness because I wasted a good bit of time on it. π¨ π¨
The current sample code documentation on the main README doesn't work with the most recently released version (2.6.2). Folks using this library should ensure they're looking at the readme on the release tag.
In particular, the sample code provided on main for DynamoDB v3 doesn't work in 2.6.2. You'll need to do the following:
import {Dynamo} from 'dynamodb-onetable/Dynamo'
import {Model, Table} from 'dynamodb-onetable'
import {DynamoDBClient} from '@aws-sdk/client-dynamodb'
const client = new Dynamo({client: new DynamoDBClient(params)})When you do not do this you'll get an error that looks a lot like this:
OneTableError: OneTable execute failed "scan" for "Model", client[DocumentClientMethods[op]](...).promise is not a function
Once again, mostly opening this so other folks can discover they're making this mistake because I wasted a decent amount of time debugging it before I realized that even though the code had been on main since April 30 there had not been a new feature release since then.