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

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

      <tfoot id='X5K1e'></tfoot>

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

        Dynamodb 過濾器表達式不返回所有結果

        Dynamodb filter expression not returning all results(Dynamodb 過濾器表達式不返回所有結果)

          <tfoot id='3MJ4Z'></tfoot>
            <bdo id='3MJ4Z'></bdo><ul id='3MJ4Z'></ul>
            <legend id='3MJ4Z'><style id='3MJ4Z'><dir id='3MJ4Z'><q id='3MJ4Z'></q></dir></style></legend>

                  <tbody id='3MJ4Z'></tbody>
              1. <small id='3MJ4Z'></small><noframes id='3MJ4Z'>

                  <i id='3MJ4Z'><tr id='3MJ4Z'><dt id='3MJ4Z'><q id='3MJ4Z'><span id='3MJ4Z'><b id='3MJ4Z'><form id='3MJ4Z'><ins id='3MJ4Z'></ins><ul id='3MJ4Z'></ul><sub id='3MJ4Z'></sub></form><legend id='3MJ4Z'></legend><bdo id='3MJ4Z'><pre id='3MJ4Z'><center id='3MJ4Z'></center></pre></bdo></b><th id='3MJ4Z'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3MJ4Z'><tfoot id='3MJ4Z'></tfoot><dl id='3MJ4Z'><fieldset id='3MJ4Z'></fieldset></dl></div>
                • 本文介紹了Dynamodb 過濾器表達式不返回所有結果的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想掃描過去 7 天的所有項目,所以我要做的是生成 7 天前的時間戳并過濾大于該值的時間戳.但此掃描返回了一些結果.

                  I want to scan all items for last 7 days, so what I do is I generate timestamp for 7 days back and filter for timestamp greater than that value. But this scan is returning a few results.

                  請參閱以下 Javascript:

                  See the following Javascript:

                  const daysBack = (days) => {
                    let date = new Date();
                    date.setDate(date.getDate() - days);
                    return date.getTime() ; 
                  }
                  
                  
                  const params = {
                    TableName: process.env.DYNAMODB_TABLE,
                    FilterExpression: "#ts > :z",
                    ExpressionAttributeNames:{
                        "#ts": "timestamp"
                    },
                    ExpressionAttributeValues: {
                        ":z": daysBack(7)
                    },
                  };
                  
                  dynamoDb.scan(params, (error, result) => {
                    // ... 
                  }
                  

                  推薦答案

                  這是因為在 SCAN 操作上 dynamoDb 只會發送 最多 1mb 的數據.如果您想要的記錄大小超過 1mb,則會自動分頁.

                  It is because on a SCAN operation dynamoDb will only send data upto 1mb only. If the records you want are of size more than 1mb automatically pagination happens.

                  如果你記錄你的結果,那么你會發現一個名為 LastEvaluatedKey 的屬性如果此屬性存在,那么您將不得不再次調用以獲取剩余數據.此調用必須遞歸實現,并且您必須在 LastEvaluatedKey 屬性不存在時停止它.

                  If you log your Result then you will find an attribute called LastEvaluatedKey if this attribute is present then you will have to make another call to get the remaining data. This call has to be implemented recursively and you have to stop it when LastEvaluatedKey attribute is not present.

                  讓我們看看這個例子,項目數據被遞歸獲取,整個數據被附加到數組中,然后發送.

                  Lets see this example where project data is been fetched recursively and the whole data is appended in the array and then send.

                  let getFromDb = function (params, callback) {
                      params.ConsistentRead = true;
                      let projectCollection = [];
                      dynamodbclient.scan(params, onQuery);
                  
                      function onQuery(err, data) {
                          const methodName = 'onQuery';
                          if (err) {
                              callback(err);
                              log.error(err, {
                                  class: className,
                                  func: methodName
                              });
                          } else {
                              for (let i = constant.LENGTH_ZERO; i < data.Items.length; i++) {
                                  projectCollection.push(data.Items[i]);
                              }
                              if (typeof data.LastEvaluatedKey !== 'undefined') {
                                  params.ExclusiveStartKey = data.LastEvaluatedKey;
                                  dynamodbclient.scan(params, onQuery);
                              } else {
                                  callback(err, projectCollection); //recursive call
                              }
                          }
                      }
                  }; 
                  

                  這篇關于Dynamodb 過濾器表達式不返回所有結果的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個多邊形點是否在傳單中的另一個內部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標記群集圖標顏色,繼承其余默認 CSS 屬性)
                  Trigger click on leaflet marker(觸發點擊傳單標記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認加載磁貼顏色?)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)
                  Leaflet - get latitude and longitude of a marker inside a pop-up(Leaflet - 在彈出窗口中獲取標記的緯度和經度)

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

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

                          • <tfoot id='b8qcB'></tfoot>
                            <legend id='b8qcB'><style id='b8qcB'><dir id='b8qcB'><q id='b8qcB'></q></dir></style></legend>

                            主站蜘蛛池模板: 国产人成精品一区二区三 | caoporn国产精品免费公开 | 亚洲精品久久久久久国产精华液 | 亚洲一区二区中文字幕 | 日本视频一区二区三区 | 国产免费一区二区 | 国产欧美在线 | 精品国产99 | 欧美日韩一区二区视频在线观看 | 欧美亚洲国产成人 | 国产精品99久久久久久人 | 欧美日日| 精品久| 欧美黄色网络 | 在线免费观看色 | 亚洲视频免费在线看 | 久久99精品久久 | 免费成人国产 | 色吧久久 | 在线永久看片免费的视频 | 国产精品久久久久久久久久久新郎 | 免费国产视频 | 正在播放国产精品 | 天天综合网永久 | 91高清在线 | 神马影院一区二区三区 | 蜜桃五月天 | 日本a级大片 | 欧美一级黄带 | www.国产 | 亚洲激情一区二区三区 | av色站| 国产高清精品一区二区三区 | 亚洲视频免费观看 | 91精品国产日韩91久久久久久 | www.色综合 | 日韩免费一二三区 | 午夜成人在线视频 | 99精品一区二区 | 久久伊人久久 | 亚洲成人久久久 |