如何从firebase实时数据库中选择数据

时间:2017-12-04 21:42:46

标签: android firebase-realtime-database nosql

我有一个结构的数据库,大致类似于

// An index to track Ada's memberships
{
  "users": {
    "alovelace": {
      "name": "Ada Lovelace",
      // Index Ada's groups in her profile
      "groups": {
         // the value here doesn't matter, just that the key exists
         "techpioneers": true,
         "womentechmakers": true
      }
    },
    ...
  },
  "groups": {
    "techpioneers": {
      "name": "Historical Tech Pioneers",
      "members": {
        "alovelace": true,
        "ghopper": true,
        "eclarke": true
      }
    },
    ...
  }
}

但我无法弄清楚如何选择属于同一组人员的用户

1 个答案:

答案 0 :(得分:0)

您必须定义一个额外的<li>group_combinations索引,您可以将每个用户存储在他们的组合下:

all_groups