How to write .indexOn for dynamic keys in firebase?

后端 未结 1 998
一整个雨季
一整个雨季 2021-02-01 16:51

I have data set up like this:

Tasks:{
  Group 1:{
    pushid1:{
      date: 18921949021,
      title: \"Do something\"
    },
    pushid2:{
      date: 189219490         


        
相关标签:
1条回答
  • 2021-02-01 17:11

    I guess you're looking for:

    {
      ".read": true,
      ".write": true,
      "rules": {
        "Tasks": {
          "$groupid": {
            ".indexOn": "date"
          }
        }
      }
    }
    

    The Firebase documentation is usually a pretty good read. Spending an hour or less in the security guide, will ensure you have a better understanding of this and many other topics.

    0 讨论(0)
提交回复
热议问题