What does priority mean in Firebase?

前端 未结 1 771
傲寒
傲寒 2020-11-30 08:40

I have read the Firebase docs about priorities but I don\'t think I understand it yet.

I think I understand that it is related to querying and sorting data. To give

相关标签:
1条回答
  • 2020-11-30 09:13

    Disclosure: I work for Firebase.

    Priorities are an optional (numeric or alphanumeric) value of each node, which is used to sort the children under a specific parent or in a query if no other sort condition is specified. The priority of a node is hidden from most views of the data. In cases where a priority is specified for a node, it can be found as a .priority property in the exportVal() of a snapshot.

    Since Firebase added the ability to order children on a specified property, priorities have lost most of their value. They are a left-over artifact from the time before Firebase had orderByChild queries. If you are starting on a Firebase project today, you should use orderByChild instead of relying on priorities.

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