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

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

      <legend id='ySMQs'><style id='ySMQs'><dir id='ySMQs'><q id='ySMQs'></q></dir></style></legend>

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

        如何确定是否确实删除了 DynamoDB 项目?

        How to determine if a DynamoDB item was indeed deleted?(如何确定是否确实删除了 DynamoDB 项目?)

                  <tbody id='xmsQN'></tbody>
                <legend id='xmsQN'><style id='xmsQN'><dir id='xmsQN'><q id='xmsQN'></q></dir></style></legend>
                <tfoot id='xmsQN'></tfoot>
                  <bdo id='xmsQN'></bdo><ul id='xmsQN'></ul>
                • <small id='xmsQN'></small><noframes id='xmsQN'>

                  <i id='xmsQN'><tr id='xmsQN'><dt id='xmsQN'><q id='xmsQN'><span id='xmsQN'><b id='xmsQN'><form id='xmsQN'><ins id='xmsQN'></ins><ul id='xmsQN'></ul><sub id='xmsQN'></sub></form><legend id='xmsQN'></legend><bdo id='xmsQN'><pre id='xmsQN'><center id='xmsQN'></center></pre></bdo></b><th id='xmsQN'></th></span></q></dt></tr></i><div id='xmsQN'><tfoot id='xmsQN'></tfoot><dl id='xmsQN'><fieldset id='xmsQN'></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 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Lucene Porter Stemmer not public(Lucene Porter Stemmer 未公开)
                  How to index pdf, ppt, xl files in lucene (java based or python or php any of these is fine)?(如何在 lucene 中索引 pdf、ppt、xl 文件(基于 java 或 python 或 php 中的任何一个都可以)?)
                  KeywordAnalyzer and LowerCaseFilter/LowerCaseTokenizer(KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer)
                  How to search between dates (Hibernate Search)?(如何在日期之间搜索(休眠搜索)?)
                  How to get positions from a document term vector in Lucene?(如何从 Lucene 中的文档术语向量中获取位置?)
                  Java Lucene 4.5 how to search by case insensitive(Java Lucene 4.5如何按不区分大小写进行搜索)

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

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

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