Is there a way to query multiple hash keys in DynamoDB?

前端 未结 6 1313
借酒劲吻你
借酒劲吻你 2021-01-01 18:57

Is there a way to query multiple hash keys using a single query in Amazon\'s AWS SDK for Java?

Here\'s my issue; I have a DB table for project statuses. The Hash

6条回答
  •  [愿得一人]
    2021-01-01 19:17

    Try this in C#. I think it's similar in Java. UserId it`s the hask key.

            var table = Table.LoadTable(DynamoClient, "YourTableName");
            var batchGet = table.CreateBatchGet();
            batchGet.AddKey(new Dictionary() { { "UserId", 123 } });
            batchGet.AddKey(new Dictionary() { { "UserId", 456 } });
            batchGet.Execute();
            var results = batchGet.Results;
    

提交回复
热议问题