本文介绍了在Swift Firebase查询中排除数据和查询部分数据的最好方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Firebase查询用户,并想知道查询所有用户除了当前 ref.authData.uid 的最佳方法。在解析它的阅读像这样......

I am querying users from Firebase and would like to know the best method to query all users excluding the current ref.authData.uid . In parse its read like this......

query?.whereKey("username", notEqualTo: PFUser.currentUser()!.username!)
query?.whereKey("username", containsString: self.searchTXTFLD.text)

此外,是否有类似于Parse的containsString的任何Firebase查询类型?

Also, is there any Firebase query type similar to Parse's containsString?

推荐答案

仅检索Firebase中符合特定条件的项目。您必须检索所有项目,并排除客户端的违规。另请参阅

There is no way to retrieve only items from Firebase that don't match a certain condition. You'll have to retrieve all items and exclude the offending ones client-side. Also see is it possible query data that are not equal to the specified condition?

对于Firebase查询,也没有 运算符。这已经被覆盖了很多次,例如在这个问题:

There is also no contains operator for Firebase queries. This has been covered many times before, such as in this question: Firebase query - Find item with child that contains string

这篇关于在Swift Firebase查询中排除数据和查询部分数据的最好方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 04:16