最佳答案
来自Best practices for data structure在文档中:
Avoid nesting data
Because the Firebase Realtime Database allows nesting data up to 32 levels deep, you might be tempted to think that this should be the default structure. However, when you fetch data at a location in your database, you also retrieve all of its child nodes. In addition, when you grant someone read or write access at a node in your database, you also grant them access to all data under that node. Therefore, in practice, it's best to keep your data structure as flat as possible.
这就是 Firebase 的工作原理:如果您获得一个项目,您也会获得它的子项目。如果您不希望这样,您应该重组数据库。
关于java - 如何在 Firebase 中仅获取子 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44561416/