gpt4 book ai didi

android - Firebase 数据库排序函数 startAt(boolean)

转载 作者:行者123 更新时间:2023-11-30 00:43:04 26 4
gpt4 key购买 nike

Firebase 数据库 startAt(boolean) 做什么?

Firebase documentation说:

Create a query constrained to only return child nodes with a value greater than or equal to the given value, using the given orderBy directive or priority as default.

bool 值如何大于另一个 bool 值?

最佳答案

一个值是否大于另一个值由排序方法定义。 Firebase 使用的方法是 explained in the documentation :

When using orderByChild(), data that contains the specified child key is ordered as follows:

  1. Children with a null value for the specified child key come first.
  2. Children with a value of false for the specified child key come next. If multiple children have a value of false, they are sorted lexicographically by key.
  3. Children with a value of true for the specified child key come next. If multiple children have a value of true, they are sorted lexicographically by key.
  4. Children with a numeric value come next, sorted in ascending order. If multiple children have the same numerical value for the specified child node, they are sorted by key.
  5. Strings come after numbers and are sorted lexicographically in ascending order. If multiple children have the same value for the specified child node, they are ordered lexicographically by key.
  6. Objects come last and are sorted lexicographically by key in ascending order.

所以就Firebase的排序而言,true大于false

关于android - Firebase 数据库排序函数 startAt(boolean),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42260544/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com