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

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

<tfoot id='I2HPQ'></tfoot>

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

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

      在 Firebase 中過濾多個子屬性的產品

      Filter products on multiple child properties in Firebase(在 Firebase 中過濾多個子屬性的產品)
        <tbody id='eypyU'></tbody>
    1. <tfoot id='eypyU'></tfoot>
    2. <legend id='eypyU'><style id='eypyU'><dir id='eypyU'><q id='eypyU'></q></dir></style></legend>

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

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

              • 本文介紹了在 Firebase 中過濾多個子屬性的產品的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我最近詢問如何根據子屬性過濾產品(請參閱:根據 Firebase 中的子子項過濾產品).

                I recently asked how to filter products based on their child property (see: Filter products based on the sub child in Firebase).

                作為回顧,我的結構如下所示:

                As a recap my structure looks as follows:

                products/
                     product1
                        /author: 12345
                        /title: "Awesome"
                        /category: "catA"
                        /description: "more awesome"
                     product2
                        /author: 67890
                        /title: "Other"
                        /category: "catB"
                        /description: "otherawesome"
                     product3
                        /author: 12345
                        /title: "Billy"
                        /category: "catB"
                        /description: "otherawesome"
                

                要過濾出作者為 12345 的所有產品,我們可以簡單地使用:

                And to filter out all products with author 12345 we can simply use:

                ref.child("products").orderByChild('author').equalTo(12345)...
                

                但是,當我有多個 AND 語句或多個 OR 語句時該怎么辦?

                如果我想過濾掉怎么辦:

                So what if I want to filter out:

                • 作者為 12345 AND 類別 catA 的所有產品(返回 product1)

                • all products with author 12345 AND category catA (returns product1)

                作者為 12345 或作者 67890 的所有產品(返回 product1product3)

                all products with author 12345 OR author 67890 (returns product1 and product3)

                對于第一部分,我嘗試了:

                For the first part, I tried:

                ref.child("products").orderByChild('author').equalTo(12345).orderByChild('category').equalTo('catA')...
                

                但這不起作用(拋出錯誤You can't combine multiple orderBy calls)

                but that did not work (throws error You can't combine multiple orderBy calls)

                另請參閱:https://www.firebase.com/docs/web/guide/retrieving-data.html#section-queries

                推薦答案

                根據我的閱讀 這里,這樣做的方法是執行第一個查詢(最好是返回最少結果的那個),然后在javascript中按另一個字段過濾.另一種方法,如果您經常執行此查詢,我建議您這樣做,是為查詢創建一個復合索引,例如;上面鏈接中 Frank van Puffelen 的回答舉了一個例子.

                From what I've read here, the way to do this is to perform the first query (preferably the one that will return the fewest results), then filter by the other field in javascript. Another way to do this, and I'd recommend this if you are performing this query often, is create a compound index for the query like; the answer by Frank van Puffelen in the link above gives an example of this.

                products/
                     product1
                        /author: 12345
                        /title: "Awesome"
                        /category: "catA"
                        /description: "more awesome"
                        /author_category: "12345_catA"
                     product2
                        /author: 67890
                        /title: "Other"
                        /category: "catB"
                        /description: "otherawesome"
                        /author_category: "67890_catB"
                     product3
                        /author: 12345
                        /title: "Billy"
                        /category: "catB"
                        /description: "otherawesome"
                        /author_category: "12345_catB"
                

                至于或",我已經找了很長時間,但沒有找到對您有幫助的東西.我建議兩個單獨的查詢.

                As for the 'OR', I've looked for quite a while and found nothing to help you. I'd suggest two separate queries.

                這篇關于在 Firebase 中過濾多個子屬性的產品的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)
                  <tfoot id='aBBbB'></tfoot>

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

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

                        <tbody id='aBBbB'></tbody>

                          主站蜘蛛池模板: 食品机械专用传感器-落料放大器-低价接近开关-菲德自控技术(天津)有限公司 | 餐饮小吃技术培训-火锅串串香培训「何小胖培训」_成都点石成金[官网] | 真丝围巾|真丝丝巾|羊绒围巾|围巾品牌|浙江越缇围巾厂家定制 | 护腰带生产厂家_磁石_医用_热压护腰_登山护膝_背姿矫正带_保健护具_医疗护具-衡水港盛 | 瓶盖扭矩测试仪-瓶盖扭力仪-全自动扭矩仪-济南三泉中石单品站 | 老城街小面官网_正宗重庆小面加盟技术培训_特色面馆加盟|牛肉拉面|招商加盟代理费用多少钱 | 数显水浴恒温振荡器-分液漏斗萃取振荡器-常州市凯航仪器有限公司 | 深圳宣传片制作-企业宣传视频制作-产品视频拍摄-产品动画制作-短视频拍摄制作公司 | 广州番禺搬家公司_天河黄埔搬家公司_企业工厂搬迁_日式搬家_广州搬家公司_厚道搬迁搬家公司 | 北京银联移动POS机办理_收银POS机_智能pos机_刷卡机_收银系统_个人POS机-谷骐科技【官网】 | 湖南自考_湖南自学考试网| LED太阳能中国结|发光红灯笼|灯杆造型灯|节日灯|太阳能灯笼|LED路灯杆装饰造型灯-北京中海轩光电 | 反渗透水处理设备|工业零排放|水厂设备|软化水设备|海南净水设备--海南水处理设备厂家 | 天津仓储物流-天津电商云仓-天津云仓一件代发-博程云仓官网 | 苏州同创电子有限公司 - 四探针测试仪源头厂家 | 阿里巴巴诚信通温州、台州、宁波、嘉兴授权渠道商-浙江联欣科技提供阿里会员办理 | 双菱电缆-广州电缆厂_广州电缆厂有限公司 | 专业甜品培训学校_广东糖水培训_奶茶培训_特色小吃培训_广州烘趣甜品培训机构 | 长沙网站建设制作「网站优化推广」-网页设计公司-速马科技官网 | 仓储货架_南京货架_钢制托盘_仓储笼_隔离网_环球零件盒_诺力液压车_货架-南京一品仓储设备制造公司 | 煤机配件厂家_刮板机配件_链轮轴组_河南双志机械设备有限公司 | 碳纤维复合材料制品生产定制工厂订制厂家-凯夫拉凯芙拉碳纤维手机壳套-碳纤维雪茄盒外壳套-深圳市润大世纪新材料科技有限公司 | 北京晚会活动策划|北京节目录制后期剪辑|北京演播厅出租租赁-北京龙视星光文化传媒有限公司 | AR开发公司_AR增强现实_AR工业_AR巡检|上海集英科技 | 武汉高低温试验箱_恒温恒湿试验箱厂家-武汉蓝锐环境科技有限公司 | PCB厂|线路板厂|深圳线路板厂|软硬结合板厂|电路板生产厂家|线路板|深圳电路板厂家|铝基板厂家|深联电路-专业生产PCB研发制造 | 悬浮拼装地板_篮球场木地板翻新_运动木地板价格-上海越禾运动地板厂家 | 定量包装机,颗粒定量包装机,粉剂定量包装机,背封颗粒包装机,定量灌装机-上海铸衡电子科技有限公司 | 合同书格式和范文_合同书样本模板_电子版合同,找范文吧 | 蒸压釜_蒸养釜_蒸压釜厂家-山东鑫泰鑫智能装备有限公司 | B2B网站_B2B免费发布信息网站_B2B企业贸易平台 - 企资网 | 地图标注|微信高德百度地图标注|地图标记-做地图[ZuoMap.com] | 胶水,胶粘剂,AB胶,环氧胶,UV胶水,高温胶,快干胶,密封胶,结构胶,电子胶,厌氧胶,高温胶水,电子胶水-东莞聚力-聚厉胶粘 | 运动木地板价格,篮球馆体育运动木地板生产厂家_欧氏地板 | 不锈钢监控杆_监控立杆厂家-廊坊耀星光电科技有限公司 | 罐体电伴热工程-消防管道电伴热带厂家-山东沃安电气 | 集菌仪_智能集菌仪_全封闭集菌仪_无菌检查集菌仪厂家-那艾 | 美缝剂_美缝剂厂家_美缝剂加盟-地老板高端瓷砖美缝剂 | 恒温恒湿试验箱_高低温试验箱_恒温恒湿箱-东莞市高天试验设备有限公司 | 浙江上沪阀门有限公司 | 广东高华家具-公寓床|学生宿舍双层铁床厂家【质保十年】 |