【问题标题】:Index nested collections in FirebaseFirebase 中的索引嵌套集合
【发布时间】:2017-12-29 07:15:13
【问题描述】:

我尝试编辑 Firebase 数据库规则并添加索引。我想同时索引大集合(产品)及其子集合之一(出价)。我试过这种方式。 为了索引大集合,我需要这样做:

"product": {
    ".indexOn":["initial_price"]
}

对于子集合的索引,我需要这样做:

"product": {
    "$productId":{  
        ".indexOn":["amount"]        
    },
}

我怎样才能把这两者结合起来?

【问题讨论】:

    标签: firebase firebase-realtime-database firebase-security


    【解决方案1】:
    "product": {
        ".indexOn":["initial_price"],
        "$productId":{  
            ".indexOn":["amount"]        
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2020-08-28
      • 1970-01-01
      • 1970-01-01
      • 2022-01-07
      • 1970-01-01
      • 2019-12-30
      • 1970-01-01
      • 2021-09-05
      • 1970-01-01
      相关资源
      最近更新 更多