Querying a Local Secondary Index using the AWS SDK for .Net

Now, we are going to see how to query a local secondary index.

Getting ready

To perform this operation, you can use the IDE of your choice. To perform the query operation, you should first add items using the AWS Console or SDK, as we have seen in the earlier chapters.

How to do it…

The Query API on a Local Secondary Index is similar to the query API on a DynamoDB table. Perform the following operations in order to query the index:

  1. Initiate the DynamoDB client with the credentials:
    client = new AmazonDynamoDBClient();
  2. Create an instance of QueryRequest specifying the keys of items you wish to fetch from the secondary index. Here, we want to fetch the item whose hash key is 1 and mnfr is samsung ...

Get DynamoDB Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.