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

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

    • <bdo id='bhD9d'></bdo><ul id='bhD9d'></ul>

    1. <tfoot id='bhD9d'></tfoot>
        <legend id='bhD9d'><style id='bhD9d'><dir id='bhD9d'><q id='bhD9d'></q></dir></style></legend>
      1. 如何确定是否确实删除了 DynamoDB 项目?

        时间:2023-09-29

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

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

                  <i id='GLJVg'><tr id='GLJVg'><dt id='GLJVg'><q id='GLJVg'><span id='GLJVg'><b id='GLJVg'><form id='GLJVg'><ins id='GLJVg'></ins><ul id='GLJVg'></ul><sub id='GLJVg'></sub></form><legend id='GLJVg'></legend><bdo id='GLJVg'><pre id='GLJVg'><center id='GLJVg'></center></pre></bdo></b><th id='GLJVg'></th></span></q></dt></tr></i><div id='GLJVg'><tfoot id='GLJVg'></tfoot><dl id='GLJVg'><fieldset id='GLJVg'></fieldset></dl></div>
                • 本文介绍了如何确定是否确实删除了 DynamoDB 项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  DynamoDB 提供了用于删除项目的 API.在返回的 DeleteItemOutcomeDeleteItemResult 中没有字段或方法来确定是否找到了 key 并且该项目确实被删除了.

                  DynamoDB provides an API for deleting items. In the returned DeleteItemOutcome and DeleteItemResult there is no field or method to determine if the key was found and the item was indeed deleted.

                  确定该项目是否确实存在和删除的唯一方法是请求项目的属性:

                  The only way to find out if the item was indeed present and deleted, is to request the items' attributes:

                  新的 DeleteItemSpec().withPrimaryKey("key","1").withReturnValues(ReturnValue.ALL_OLD))

                  但是,这会消耗额外的读取容量.有没有更有效的方法来检查删除结果 - 找到和删除的键/无效键?

                  This, however, consumes extra read capacity. Is there a more efficient way to check the delete result - key found and deleted / invalid key?

                  推荐答案

                  DeleteItemResult#getAttributes()方法 来确定一个 DeleteItem 操作实际上已经删除了一个项目,或者没有.

                  DeleteItemResult#getAttributes() is the way to determine if a DeleteItem operation has actually deleted an item, or not.

                  如果您指定 ReturnValue.ALL_OLD 并且项目被删除,则返回项目属性映射,否则返回空映射.这是确定操作是否成功的唯一方法.API 不会返回其他确认信息.

                  If you specify ReturnValue.ALL_OLD and the item was deleted, a map of item attributes is returned, otherwise and empty map is returned. This is the only way to know for sure if the operation was successful. No other confirmation is returned by the API.

                  请记住,DeleteItem 操作每次至少会消耗 1 个写入容量单位.如果删除的item大于1KB,消耗的容量会大于1.

                  Keep in mind that a DeleteItem operation will consume a minimum of 1 write capacity unit every time. If the deleted item is larger than 1KB, consumed capacity will be more than 1.

                  供参考: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/CapacityUnitCalculations.html#ItemSizeCalculations.Writes

                  这篇关于如何确定是否确实删除了 DynamoDB 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:AWS Java SDK 中 DynamoDB v2 的迁移详细信息? 下一篇:Java SDK 中的 AmazonDynamoDBClient 和 DynamoDB 类之间的区

                  相关文章

                  最新文章

                  <i id='YqiVK'><tr id='YqiVK'><dt id='YqiVK'><q id='YqiVK'><span id='YqiVK'><b id='YqiVK'><form id='YqiVK'><ins id='YqiVK'></ins><ul id='YqiVK'></ul><sub id='YqiVK'></sub></form><legend id='YqiVK'></legend><bdo id='YqiVK'><pre id='YqiVK'><center id='YqiVK'></center></pre></bdo></b><th id='YqiVK'></th></span></q></dt></tr></i><div id='YqiVK'><tfoot id='YqiVK'></tfoot><dl id='YqiVK'><fieldset id='YqiVK'></fieldset></dl></div>
                  1. <small id='YqiVK'></small><noframes id='YqiVK'>

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

                    1. <tfoot id='YqiVK'></tfoot><legend id='YqiVK'><style id='YqiVK'><dir id='YqiVK'><q id='YqiVK'></q></dir></style></legend>