<legend id='uK3wg'><style id='uK3wg'><dir id='uK3wg'><q id='uK3wg'></q></dir></style></legend>
<i id='uK3wg'><tr id='uK3wg'><dt id='uK3wg'><q id='uK3wg'><span id='uK3wg'><b id='uK3wg'><form id='uK3wg'><ins id='uK3wg'></ins><ul id='uK3wg'></ul><sub id='uK3wg'></sub></form><legend id='uK3wg'></legend><bdo id='uK3wg'><pre id='uK3wg'><center id='uK3wg'></center></pre></bdo></b><th id='uK3wg'></th></span></q></dt></tr></i><div id='uK3wg'><tfoot id='uK3wg'></tfoot><dl id='uK3wg'><fieldset id='uK3wg'></fieldset></dl></div>
    • <bdo id='uK3wg'></bdo><ul id='uK3wg'></ul>

        <tfoot id='uK3wg'></tfoot>
      1. <small id='uK3wg'></small><noframes id='uK3wg'>

        有没有办法在 DynamoDB 中查询多个哈希键?

        时间:2023-09-28

        • <i id='dFH8f'><tr id='dFH8f'><dt id='dFH8f'><q id='dFH8f'><span id='dFH8f'><b id='dFH8f'><form id='dFH8f'><ins id='dFH8f'></ins><ul id='dFH8f'></ul><sub id='dFH8f'></sub></form><legend id='dFH8f'></legend><bdo id='dFH8f'><pre id='dFH8f'><center id='dFH8f'></center></pre></bdo></b><th id='dFH8f'></th></span></q></dt></tr></i><div id='dFH8f'><tfoot id='dFH8f'></tfoot><dl id='dFH8f'><fieldset id='dFH8f'></fieldset></dl></div>

                  <bdo id='dFH8f'></bdo><ul id='dFH8f'></ul>
                  <legend id='dFH8f'><style id='dFH8f'><dir id='dFH8f'><q id='dFH8f'></q></dir></style></legend>
                • <tfoot id='dFH8f'></tfoot>

                  <small id='dFH8f'></small><noframes id='dFH8f'>

                    <tbody id='dFH8f'></tbody>
                • 本文介绍了有没有办法在 DynamoDB 中查询多个哈希键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  有没有办法在亚马逊的 AWS SDK for Java 中使用单个查询来查询多个哈希键?

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

                  这是我的问题;我有一个项目状态的数据库表.哈希键是项目的状态(即:新建、分配、处理或完成).范围键是一组项目 ID.目前,我有一个查询设置来简单地查找列为已分配"状态(哈希)的所有项目和另一个查询设置来查找处理"状态.有没有办法使用单个查询来执行此操作,而不是为我需要查找的每个状态发送多个查询?代码如下:

                  Here's my issue; I have a DB table for project statuses. The Hash Key is the status of a project (ie: new, assigned, processing, or complete). The range key is a set of project IDs. Currently, I've got a query setup to simply find all the projects listed as a status(hash) of "assigned" and another query set to look for a status of "processing". Is there a way to do this using a single query rather than sending multiple queries for each status I need to find? Code below:

                      DynamoDBMapper mapper = new DynamoDBMapper(new AmazonDynamoDBClient(credentials));
                      PStatus assignedStatus = new PStatus();
                      assignedStatus.setStatus("assigned");
                      PStatus processStatus = new PStatus();
                      processStatus.setStatus("processing");
                  
                      DynamoDBQueryExpression<PStatus> queryAssigned = new DynamoDBQueryExpression<PStatus>().withHashKeyValues(assignedStatus);
                      DynamoDBQueryExpression<PStatus> queryProcessing = new DynamoDBQueryExpression<PStatus>().withHashKeyValues(processStatus);
                  
                      List<PStatus> assigned = mapper.query(PStatus.class, queryAssigned);
                      List<PStatus> process = mapper.query(PStatus.class, queryProcessing);
                  

                  所以基本上,我想知道是否可以消除 queryAssignedassigned 变量并同时处理 assignedStatusprocessStatus 通过相同的查询 process 来查找不是新的或不完整的项目.

                  So basically, I'd like to know if it's possible to eliminate the queryAssigned and assigned variables and handle both assignedStatus and processStatus via the same query, process, to find projects that are not new or complete.

                  推荐答案

                  不,截至目前,无法在同一个请求中发送多个查询.如果您担心延迟,您可以在不同的线程中同时发出多个请求.如果 Dynamo 提供它,这将需要与双重查询"相同数量的网络带宽(假设您制作 2​​ 个,而不是数百个).

                  No, as of today there is no way to send multiple queries in the same request. If you're concerned about latency, you could make multiple requests simultaneously in different threads. This would require the same amount of network bandwidth as a "dual query" would if Dynamo offered it (assuming you're making 2, not hundreds).

                  这篇关于有没有办法在 DynamoDB 中查询多个哈希键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何更新 AWS DynamoDB 文档 API 上的地图或列表? 下一篇:如何使用 Java 设置 DynamoDB 返回的匹配项的限制

                  相关文章

                  最新文章

                    <bdo id='NqZq2'></bdo><ul id='NqZq2'></ul>

                      <legend id='NqZq2'><style id='NqZq2'><dir id='NqZq2'><q id='NqZq2'></q></dir></style></legend>
                      <i id='NqZq2'><tr id='NqZq2'><dt id='NqZq2'><q id='NqZq2'><span id='NqZq2'><b id='NqZq2'><form id='NqZq2'><ins id='NqZq2'></ins><ul id='NqZq2'></ul><sub id='NqZq2'></sub></form><legend id='NqZq2'></legend><bdo id='NqZq2'><pre id='NqZq2'><center id='NqZq2'></center></pre></bdo></b><th id='NqZq2'></th></span></q></dt></tr></i><div id='NqZq2'><tfoot id='NqZq2'></tfoot><dl id='NqZq2'><fieldset id='NqZq2'></fieldset></dl></div>

                      <small id='NqZq2'></small><noframes id='NqZq2'>

                    1. <tfoot id='NqZq2'></tfoot>