![]() ![]() This command scans the SampleTable table and selects only the pk attribute for each item. If your partition key attribute name is different, you’ll just need to adjust the sample code to match your table schema.Īws dynamodb scan -table-name SampleTable \ Note that all of the samples in this post assume that the table has a partition key attribute named pk. The following code shows how to do a full table scan using the AWS Command Line Interface (AWS CLI) to extract the partition keys. Each item returned by the scan will have a unique partition key value. If your table schema has only a partition key (no sort key), then generating a distinct list of partition keys can be done fairly efficiently using a table scan. You need to know the partition keys in order to insert the new items. You are rolling out a new feature and want to insert a new item into each item collection (an item collection is the set of items having the same partition key but different sort key values).It might be the ID of the device, shopping cart, game, or whatever entity type is being held in the table. It doesn’t have to be a customer, of course. The partition key is a customer ID and you want a list of all customers held in the table.There are a few situations where you might want a distinct list of partition keys: This post discusses various mechanisms to retrieve all partition key values. There may be times when instead of using partition keys to access items you want to pull the full list of distinct partition keys. You use these index keys when accessing items in the table: storing and retrieving items or making query calls. Every table in DynamoDB has a schema which specifies if it has a simple partition key (for pure key-value lookups), or a partition key and sort key both (for more complex query patterns). Amazon DynamoDB is a fully managed, serverless NoSQL database service that provides fast and predictable performance with seamless scalability. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |