pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="dzvz9nz" 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="r5dndlp" id='w24vs'><tfoot id='w24vs'></tfoot><dl id='w24vs'><fieldset id='w24vs'></fieldset></dl></div>
                  本文介紹了在非關(guān)鍵屬性上查詢 DynamoDB的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  是否可以在 AWS 版本 2 中使用非關(guān)鍵屬性過(guò)濾 DynamoDB 查詢?亞馬遜表示他們可以做到:http://amzn.to/1FVgQ9B.但是他們也提供 API 嗎?我找到了 AWSDynamoDBQueryExpression,但我認(rèn)為它只允許過(guò)濾范圍鍵(沒(méi)有足夠的文檔).我正在 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!

                  推薦答案

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

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

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

                  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.

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

                  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)鍵屬性的已批準(zhǔn)"字段進(jìn)行過(guò)濾.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的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  CLLocation returning negative speed(CLLocation 返回負(fù)速度)
                  Locations in Core Data sorted by distance via NSFetchedResultsController?(通過(guò) 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 跟蹤設(shè)備位置(iOS 和 Android)設(shè)備)
                  Easiest way of getting reverse geocoded current location from iOS(從 iOS 獲取反向地理編碼當(dāng)前位置的最簡(jiǎn)單方法)
                    <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="nznj5b5" 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'>

                            主站蜘蛛池模板: 优宝-汽车润滑脂-轴承润滑脂-高温齿轮润滑油脂厂家 | 浩方智通 - 防关联浏览器 - 跨境电商浏览器 - 云雀浏览器 | 合肥废气治理设备_安徽除尘设备_工业废气处理设备厂家-盈凯环保 合肥防火门窗/隔断_合肥防火卷帘门厂家_安徽耐火窗_良万消防设备有限公司 | 百度关键词优化_网站优化_SEO价格 - 云无限好排名| 超声波电磁流量计-液位计-孔板流量计-料位计-江苏信仪自动化仪表有限公司 | 合肥风管加工厂-安徽螺旋/不锈钢风管-通风管道加工厂家-安徽风之范 | 德国UST优斯特氢气检漏仪-德国舒赐乙烷检测仪-北京泽钏 | 匀胶机旋涂仪-声扫显微镜-工业水浸超声-安赛斯(北京)科技有限公司 | 无线讲解器-导游讲解器-自助讲解器-分区讲解系统 品牌生产厂家[鹰米讲解-合肥市徽马信息科技有限公司] | 餐饮小吃技术培训-火锅串串香培训「何小胖培训」_成都点石成金[官网] | 铁艺,仿竹,竹节,护栏,围栏,篱笆,栅栏,栏杆,护栏网,网围栏,厂家 - 河北稳重金属丝网制品有限公司 山东太阳能路灯厂家-庭院灯生产厂家-济南晟启灯饰有限公司 | 接地电阻测试仪[厂家直销]_电缆故障测试仪[精准定位]_耐压测试仪-武汉南电至诚电力设备 | 深圳网站建设-高端企业网站开发-定制网页设计制作公司 | 自动化展_机器人展_机床展_工业互联网展_广东佛山工博会 | 电子海图系统-电梯检验系统-智慧供热系统开发-商品房预售资金监管系统 | 色谱柱-淋洗液罐-巴罗克试剂槽-巴氏吸管-5ml样品瓶-SBS液氮冻存管-上海希言科学仪器有限公司 | TPE塑胶原料-PPA|杜邦pom工程塑料、PPSU|PCTG材料、PC/PBT价格-悦诚塑胶 | 天一线缆邯郸有限公司_煤矿用电缆厂家_矿用光缆厂家_矿用控制电缆_矿用通信电缆-天一线缆邯郸有限公司 | 磁粉制动器|张力控制器|气胀轴|伺服纠偏控制器整套厂家--台灵机电官网 | 无缝钢管-聊城无缝钢管-小口径无缝钢管-大口径无缝钢管 - 聊城宽达钢管有限公司 | 单螺旋速冻机-双螺旋-流态化-隧道式-食品速冻机厂家-广州冰泉制冷 | 河南膏药贴牌-膏药代加工-膏药oem厂家-洛阳今世康医药科技有限公司 | 杭州双螺杆挤出机-百科| 上海防爆真空干燥箱-上海防爆冷库-上海防爆冷柜?-上海浦下防爆设备厂家? | 西安文都考研官网_西安考研辅导班_考研培训机构_西安在职考研培训 | 企典软件一站式企业管理平台,可私有、本地化部署!在线CRM客户关系管理系统|移动办公OA管理系统|HR人事管理系统|人力 | 福建成考网-福建成人高考网| 高低温万能试验机-复合材料万能试验机-馥勒仪器 | 苏州西朗门业-欧盟CE|莱茵UL双认证的快速卷帘门品牌厂家 | 浙江华锤电器有限公司_地磅称重设备_防作弊地磅_浙江地磅售后维修_无人值守扫码过磅系统_浙江源头地磅厂家_浙江工厂直营地磅 | elisa试剂盒-PCR试剂盒「上海谷研实业有限公司」 | 宝元数控系统|对刀仪厂家|东莞机器人控制系统|东莞安川伺服-【鑫天驰智能科技】 | 叉车电池-叉车电瓶-叉车蓄电池-铅酸蓄电池-电动叉车蓄电池生产厂家 | SPC工作站-连杆综合检具-表盘气动量仪-内孔缺陷检测仪-杭州朗多检测仪器有限公司 | 精密冲床,高速冲床等冲压设备生产商-常州晋志德压力机厂 | 不锈钢发酵罐_水果酒发酵罐_谷物发酵罐_山东誉诚不锈钢制品有限公司 | 存包柜厂家_电子存包柜_超市存包柜_超市电子存包柜_自动存包柜-洛阳中星 | 悬浮拼装地板_篮球场木地板翻新_运动木地板价格-上海越禾运动地板厂家 | 福尔卡(北京)新型材料技术股份有限公司 | 煤矿人员精确定位系统_矿用无线通信系统_煤矿广播系统 | ★店家乐|服装销售管理软件|服装店收银系统|内衣店鞋店进销存软件|连锁店管理软件|收银软件手机版|会员管理系统-手机版,云版,App |