Get Firebase child nodes' names without getting their children too in Firebase response?

前端 未结 2 832
闹比i
闹比i 2020-12-16 15:24

I have the following hierarchy on firebase, some data are hidden for confidentiality:

\"enter

2条回答
  •  既然无缘
    2020-12-16 15:50

    UPDATE: There is now a shallow command in the REST API that will fetch just the keys for a path. This has not been added to the SDKs yet.

    In Firebase, you can't obtain a list of node names without retrieving the data underneath. Not yet anyways. The performance problems can be addressed with normalization.

    Essentially, your goal is to split data into consumable chunks. Store your list of video keys, possible with a couple meta fields like title, etc, in one path, and store the bulk content somewhere else. For example:

    /video_meta/id/link, title, ...
    /video_lines/id/...
    

    To learn more about denormalizing, check out this article: https://www.firebase.com/blog/2013-04-12-denormalizing-is-normal.html

提交回复
热议问题