久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

        如何使用 Java 設(shè)置 DynamoDB 返回的匹配項(xiàng)的限制

        How to set limit of matching items returned by DynamoDB using Java?(如何使用 Java 設(shè)置 DynamoDB 返回的匹配項(xiàng)的限制?)

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

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

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

                  本文介紹了如何使用 Java 設(shè)置 DynamoDB 返回的匹配項(xiàng)的限制?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  在我的 Android 應(yīng)用程序中,我想從 DynamoDB 查詢數(shù)據(jù).會(huì)有一千個(gè)匹配的項(xiàng)目,但我只想得到前 10 個(gè).我不知道如何設(shè)置這個(gè)限制.我在文檔中找到了這些行:

                  In my Android app, I want to query data from DynamoDB. There will be a thousand matching items, but I just want to get only the first 10 of them. I don't know how to set this limit. I found these lines in documentation:

                  DynamoDB 查詢和掃描 API 允許使用 Limit 值來限制結(jié)果的大小.

                  The DynamoDB Query and Scan APIs allow a Limit value to restrict the size of the results.

                  在請(qǐng)求中,將 Limit 參數(shù)設(shè)置為您希望 DynamoDB 在返回結(jié)果之前處理的項(xiàng)目數(shù).

                  In a request, set the Limit parameter to the number of items that you want DynamoDB to process before returning results.

                  在響應(yīng)中,DynamoDB 返回限制值范圍內(nèi)的所有匹配結(jié)果.例如,如果您發(fā)出限制值為 6 且沒有過濾器表達(dá)式的 Query 或 Scan 請(qǐng)求,則 DynamoDB 會(huì)返回表中與請(qǐng)求中指定的鍵條件匹配的前六個(gè)項(xiàng)目(或僅返回表中的前六個(gè)項(xiàng)目).沒有過濾器的掃描的情況).如果您還提供 FilterExpression 值,DynamoDB 將返回前六個(gè)中也符合過濾器要求的項(xiàng)目(返回的結(jié)果數(shù)將小于或等于 6).

                  但我找不到設(shè)置響應(yīng)限制的方法.我找到了QueryResult的SetCount方法:

                  But I cannot find the way to set limit for response. I found the method SetCount of QueryResult:

                  QueryResult result2 = dynamodb.query(request);
                      result2.setCount(5);
                  

                  上面說:那么Count就是應(yīng)用過濾器后返回的項(xiàng)目數(shù)

                  但我認(rèn)為這不是我想要的.因?yàn)?DynamoDb 在調(diào)用 setCount 之前仍然返回所有匹配項(xiàng).誰能幫幫我?

                  But I think it is not what I want. Because DynamoDb still returns all the matching items before calling setCount. Can any one help me?

                  推薦答案

                  您需要在發(fā)送到 API 的請(qǐng)求中應(yīng)用限制,而不是在響應(yīng)中.

                  You need to apply the limit as part of the request that you send to the API, not on the response.

                  我假設(shè)您提交給 dynamodb 對(duì)象的請(qǐng)求對(duì)象是 QuerySpec.您要做的是調(diào)用 withMaxResultSize 在針對(duì) API 運(yùn)行查詢之前傳入您希望應(yīng)用的限制.

                  I assume the request object you are submitting to the dynamodb object is a QuerySpec. What you will want to do is is call withMaxResultSize to pass in the limit you want applied before the query is run against the API.

                  但是,正如您在問題中提到的,您需要確保了解 限制:

                  However, as you mentioned in your question you need to make sure you understand the behavior of limit as described in the DynamoDB documentation on Limits:

                  在響應(yīng)中,DynamoDB 返回限值的范圍.例如,如果您發(fā)出查詢或掃描限制值為 6 且沒有過濾器表達(dá)式的請(qǐng)求,DynamoDB 返回表中與請(qǐng)求中指定的關(guān)鍵條件(或僅前六項(xiàng)在沒有過濾器的掃描的情況下).如果您還提供FilterExpression 值,DynamoDB 將返回第一個(gè) 中的項(xiàng)目六個(gè)也符合過濾器要求(結(jié)果的數(shù)量返回將小于或等于 6).

                  In a response, DynamoDB returns all the matching results within the scope of the Limit value. For example, if you issue a Query or a Scan request with a Limit value of 6 and without a filter expression, DynamoDB returns the first six items in the table that match the specified key conditions in the request (or just the first six items in the case of a Scan with no filter). If you also supply a FilterExpression value, DynamoDB will return the items in the first six that also match the filter requirements (the number of results returned will be less than or equal to 6).

                  這意味著,如果您不使用 FilterExpression,您可能會(huì)沒事.但是,如果您正在過濾結(jié)果,您收到的結(jié)果可能會(huì)少于您的限制,因?yàn)閺募夹g(shù)上講,限制不是要返回的結(jié)果數(shù),而是 DynamoDB 可能返回的項(xiàng)目數(shù).

                  What this means is that if you are not using a FilterExpression you are likely fine. However, if you are filtering the results you will likely receive fewer than your limit because the limit is technically not the number of results to return rather the number of items DynamoDB could potentially return.

                  聽起來您在尋求一種方法,讓 DynamoDB 在應(yīng)用 FilterExpression 的同時(shí)將返回的結(jié)果數(shù)量限制為精確數(shù)字.不幸的是,DynamoDB 目前無法做到這一點(diǎn).

                  It sounds like you are asking for a way to have DynamoDB limit the number of results it returns to an exact number while having a FilterExpression applied. Unfortunately this is currently not possible with DynamoDB.

                  這篇關(guān)于如何使用 Java 設(shè)置 DynamoDB 返回的匹配項(xiàng)的限制?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測(cè) 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關(guān)系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個(gè)隨機(jī)打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?0xff000000 存儲(chǔ)為 int?)
                1. <i id='0zBqk'><tr id='0zBqk'><dt id='0zBqk'><q id='0zBqk'><span id='0zBqk'><b id='0zBqk'><form id='0zBqk'><ins id='0zBqk'></ins><ul id='0zBqk'></ul><sub id='0zBqk'></sub></form><legend id='0zBqk'></legend><bdo id='0zBqk'><pre id='0zBqk'><center id='0zBqk'></center></pre></bdo></b><th id='0zBqk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0zBqk'><tfoot id='0zBqk'></tfoot><dl id='0zBqk'><fieldset id='0zBqk'></fieldset></dl></div>

                    <bdo id='0zBqk'></bdo><ul id='0zBqk'></ul>
                    <tfoot id='0zBqk'></tfoot>

                    • <small id='0zBqk'></small><noframes id='0zBqk'>

                        <legend id='0zBqk'><style id='0zBqk'><dir id='0zBqk'><q id='0zBqk'></q></dir></style></legend>

                          <tbody id='0zBqk'></tbody>
                          • 主站蜘蛛池模板: 亚州综合在线 | 99热播精品 | 国产日韩精品在线 | 国产第一页在线观看 | 日本久久www成人免 成人久久久久 | 草草视频在线观看 | 欧美在线观看一区 | 亚洲一区二区av在线 | 国产精品一区二区av | av毛片 | 九九亚洲| 一区二区在线免费观看 | 国产福利视频 | 人人爽日日躁夜夜躁尤物 | 粉嫩高清一区二区三区 | 一区二区三区在线观看视频 | 久热精品在线播放 | 91免费在线视频 | 国产精品小视频在线观看 | 人和拘一级毛片c | 久久综合久色欧美综合狠狠 | 久久99精品视频 | 成人一区在线观看 | 中文字幕在线视频精品 | 九色国产 | 亚洲精品欧美 | 涩涩片影院| 久久黄网| 91色视频在线观看 | 国产一二区视频 | 久在线 | 欧美日韩精品一区二区三区视频 | 国产sm主人调教女m视频 | 国产精品久久久久久久久久 | 久久久成人网 | 国产精彩视频 | 日日天天 | 在线观看av网站永久 | 国产精品777一区二区 | 国产精品国产馆在线真实露脸 | 国产不卡视频在线 |