aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.96k stars 557 forks source link

(short issue description) #6083

Closed jsheld closed 1 month ago

jsheld commented 1 month ago

Describe the issue

Lack of clarity, horrible examples

Links

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/command/GetItemCommand/

I've been frustrated with this documentation - all of the Dynamo documentation is very poor. In this specific example, you have a line of code commented out (it looks like that was for v2 of the sdk for JavaScript) and this line:

const client = new DynamoDBClient(config);

is using an object config that is not defined anywhere, so I'm left guessing as to what should go here. Moreover, look at the documentation for DynamoDBClient and I can't find anything useful. Does anyone read these examples?

jsheld commented 1 month ago

I figured this out but it took going to way too many articles. The examples in general are incomplete, have comments in them, and lack sufficent explanation. For example, I finally stumbled on https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/programming-with-javascript.html, which did a good job of explaining using the low-level vs. high-level client. The information there was useful and got me unblocked. What was unclear and what I found elsewhere was that when I constructed my table, I had both a partition key and a sort key. Initially I was only specifying the partition key. Using a pk and sk requires that you use both. In the doc I referenced above, it says "The GetItem operation returns a set of attributes for the item with the given primary key". This is wrong and misleading and ended up taking me too many hours to figure out what was going on. Pls update it accordingly.

github-actions[bot] commented 1 month ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.