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

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

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

    1. <small id='MtBkQ'></small><noframes id='MtBkQ'>

        在非關(guān)鍵屬性上查詢 DynamoDB

        Querying DynamoDB on non-key attributes(在非關(guān)鍵屬性上查詢 DynamoDB)
          <tbody id='w24vs'></tbody>
      1. <tfoot id='w24vs'></tfoot>
            <bdo id='w24vs'></bdo><ul id='w24vs'></ul>

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

                  <legend id='w24vs'><style id='w24vs'><dir id='w24vs'><q id='w24vs'></q></dir></style></legend>
                1. <i id='w24vs'><tr id='w24vs'><dt id='w24vs'><q id='w24vs'><span id='w24vs'><b id='w24vs'><form id='w24vs'><ins id='w24vs'></ins><ul id='w24vs'></ul><sub id='w24vs'></sub></form><legend id='w24vs'></legend><bdo id='w24vs'><pre id='w24vs'><center id='w24vs'></center></pre></bdo></b><th id='w24vs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='w24vs'><tfoot id='w24vs'></tfoot><dl id='w24vs'><fieldset id='w24vs'></fieldset></dl></div>
                  本文介紹了在非關(guān)鍵屬性上查詢 DynamoDB的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  是否可以在 AWS 版本 2 中使用非關(guān)鍵屬性過濾 DynamoDB 查詢?亞馬遜表示他們可以做到:http://amzn.to/1FVgQ9B.但是他們也提供 API 嗎?我找到了 AWSDynamoDBQueryExpression,但我認為它只允許過濾范圍鍵(沒有足夠的文檔).我正在 iOS 和 AWS 版本 2 中尋找合適的 API.謝謝!

                  Is it possible to filter DynamoDB queries using non-key attributes in AWS version 2 ? Amazon says that they can do it: http://amzn.to/1FVgQ9B. But do they also give the API? I found AWSDynamoDBQueryExpression, but I think it only lets filtering on the range key (not enough documentation). I'm looking for the proper API in iOS and AWS version 2. Thanks!

                  推薦答案

                  我正在回答我自己的問題.這也是我在 AWS 支持論壇上發(fā)布的內(nèi)容:

                  I'm answering my own question. This is what I posted on AWS support forum as well:

                  您無法使用高級 API -- AWSDynamoDBObjectMapper 來執(zhí)行此操作.使用 AWSDynamoDBObjectMapper 時,需要向查詢方法提供一個 AWSDynamoDBQueryExpression 對象來指定查詢條件.AWSDynamoDBQueryExpression 沒有為您提供在非關(guān)鍵屬性上設置過濾器(條件)的選項.我想知道為什么不支持這個!但是,AWSDynamoDBScanExpression 允許您在使用掃描方法時指定非關(guān)鍵屬性的條件.但是,當您真正的意思是查詢時,您不想掃描.

                  You can't do this with the high level API -- AWSDynamoDBObjectMapper. When using AWSDynamoDBObjectMapper, you need to provide an AWSDynamoDBQueryExpression object to the query method to specify the query conditions. AWSDynamoDBQueryExpression doesn't give you the option to set filters(conditions) on non-key attributes. I wonder why this isn't supported! However, AWSDynamoDBScanExpression lets you specify conditions on non-key attributes when you use the scan method. But you don't want to scan when you actually mean a query.

                  幸運的是,您可以使用低級別 API 執(zhí)行此操作,方法是直接在 AWSDynamoDB 上調(diào)用查詢,提供 AWSDynamoDBQueryInput,讓您可以指定許多低級別參數(shù).AWSDynamoDBQueryInput 允許您使用 queryFilter 或 filterExpression 指定非鍵屬性的過濾條件.不推薦使用 queryFilter,建議使用 filterExpression.以下是幫助我解決這個問題的兩個文件:

                  Fortunately, you can do this using the low level API by directly calling query on AWSDynamoDB providing an AWSDynamoDBQueryInput which lets you specify a lot of low level parameters. AWSDynamoDBQueryInput lets you specify the filter conditions on non-key attributes using either queryFilter or filterExpression. queryFilter is deprecated, it's recommended to use filterExpression. Here are the two documents that helped me to figure this out:

                  http://docs.aws.amazon.com/amazondynamodb/最新/APIReference/API_Query.htmlhttp://docs.aws.amazon.com/AWSiOSSDK/latest/Classes/AWSDynamoDBQueryInput.html

                  這是 swift 中的代碼示例.在此代碼中,我基于作為非關(guān)鍵屬性的已批準"字段進行過濾.recId 為主鍵:

                  Here's a code example in swift. In this code I'm filtering based on "approved" field that is a non-key attribute. recId is the primary key:

                      func getApprovedRecords(recId: Int) {
                  
                  
                  
                       let dynamoDB = AWSDynamoDB.defaultDynamoDB()
                  
                          var startKey = nil
                  
                          var queryInput = AWSDynamoDBQueryInput()
                  
                          queryInput.tableName = TABLE_NAME
                  
                          queryInput.limit = QUERY_SIZE
                  
                          queryInput.exclusiveStartKey = startKey
                  
                  
                  
                          var recIdValue = AWSDynamoDBAttributeValue()
                  
                          recIdValue.N = String(recId)
                  
                          var recIdCondition = AWSDynamoDBCondition()
                  
                          recIdCondition.comparisonOperator = AWSDynamoDBComparisonOperator.EQ
                  
                          recIdCondition.attributeValueList = [recIdValue]
                  
                  
                  
                          queryInput.keyConditions = [ "recId"" : recIdCondition]
                  
                  
                          var oneValue = AWSDynamoDBAttributeValue()
                  
                          oneValue.N = "1"
                  
                  
                  
                          queryInput.expressionAttributeValues = [ ":one" : oneValue ]    
                  
                          queryInput.filterExpression = "approved = :one"
                  
                          dynamoDB.query(queryInput).continueWithBlock { (task: BFTask!) -> AnyObject! in
                  
                              if ((task.error) != nil) {
                  
                                  NSLog("The request failed. Error: (task.error)")
                  
                              }
                  
                              if ((task.exception) != nil) {
                  
                                  NSLog("The request failed. Exception: (task.exception)")
                  
                              }
                  
                              if ((task.result) != nil) {
                  
                                  NSLog("The request  succeeded.")
                  
                                  let results = task.result as! AWSDynamoDBQueryOutput
                  
                                  for r in results.items {
                  
                                      // do whatever with the result
                  
                                  }
                  
                              }
                  
                              return nil
                  
                          }
                  
                      }
                  

                  這篇關(guān)于在非關(guān)鍵屬性上查詢 DynamoDB的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  CLLocation returning negative speed(CLLocation 返回負速度)
                  Locations in Core Data sorted by distance via NSFetchedResultsController?(通過 NSFetchedResultsController 按距離排序的核心數(shù)據(jù)中的位置?)
                  Swift: Geofencing / geolocations near user location(Swift:用戶位置附近的地理圍欄/地理位置)
                  How to get Location (latitude amp; longitude value) in variable on iOS?(如何在 iOS 上的變量中獲取位置(緯度和經(jīng)度值)?)
                  How to track the device location (iOS and Android) device using Phonegap(如何使用 Phonegap 跟蹤設備位置(iOS 和 Android)設備)
                  Easiest way of getting reverse geocoded current location from iOS(從 iOS 獲取反向地理編碼當前位置的最簡單方法)
                    <i id='hpdmt'><tr id='hpdmt'><dt id='hpdmt'><q id='hpdmt'><span id='hpdmt'><b id='hpdmt'><form id='hpdmt'><ins id='hpdmt'></ins><ul id='hpdmt'></ul><sub id='hpdmt'></sub></form><legend id='hpdmt'></legend><bdo id='hpdmt'><pre id='hpdmt'><center id='hpdmt'></center></pre></bdo></b><th id='hpdmt'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hpdmt'><tfoot id='hpdmt'></tfoot><dl id='hpdmt'><fieldset id='hpdmt'></fieldset></dl></div>

                      1. <legend id='hpdmt'><style id='hpdmt'><dir id='hpdmt'><q id='hpdmt'></q></dir></style></legend>
                          <bdo id='hpdmt'></bdo><ul id='hpdmt'></ul>
                          <tfoot id='hpdmt'></tfoot>
                              <tbody id='hpdmt'></tbody>

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

                            主站蜘蛛池模板: 99精彩视频| 成人精品鲁一区一区二区 | 中文字幕亚洲一区 | 91福利影院 | 神马久久av | 一区二区精品在线 | 国产精品乱码一区二三区小蝌蚪 | 91欧美| 中文字幕亚洲精品 | 亚洲精品一区中文字幕乱码 | 免费国产黄| 欧美亚洲国产精品 | 国产精品123区 | 中文字幕亚洲精品 | 欧美视频免费在线 | 欧美日韩一区在线观看 | 欧美区在线观看 | 亚洲字幕在线观看 | 国外成人免费视频 | 一区二区三区久久 | 久久综合色综合 | 亚洲一区不卡在线 | 久久久91精品国产一区二区三区 | 色精品视频| 亚洲欧美日韩网站 | 中文字幕97 | 成人精品一区二区三区中文字幕 | 国产精品免费一区二区三区四区 | 中文二区 | 在线观看免费高清av | 成人午夜免费视频 | 一区二区三区成人 | 欧美成人免费在线 | 福利一区视频 | 一区二区三区四区在线 | 欧美国产日韩一区二区三区 | 亚洲一区欧美一区 | 亚洲精品乱 | 亚洲欧美日韩一区二区 | 久久综合婷婷 | 国产日韩欧美另类 |