我的Firebase节点是这样的......
Member
-Kr4RLvm2ObnbnRvWXeb-wEr
Age: "32"
Email: "samaaa@uil.gl"
IsActive: true
ManagerId: "170809sam@uil.gl"
MemberId: "170809sam@uil.gl"
Name: "Samiufgfgl alfgfgam"
-Kr4RLvmbnbn2ORvWXeb-wEr
Age: "34"
Email: "sasssm@uil.gl"
IsActive: true
ManagerId: "170809sam@uil.gl"
MemberId: "170809sam@uil.gl"
Name: "Samfgfgiul alam"
-Kr4RLvm2OghghRvWXeb-wEr
Age: "39"
Email: "sacccm@uil.gl"
IsActive: true
ManagerId: "170809sam@uil.gl"
MemberId: "170809sam@uil.gl"
Name: "Samfffiul alam"
-Kr4RLvm2ObvnbvnbvnRvWXeb-wEr
Age: "66"
Email: "sabbbm@uil.gl"
IsActive: false
ManagerId: "170809sam@uil.gl"
MemberId: "170809sam@uil.gl"
Name: "Samigggul alam"
我能够以这种方式从Xamarin中检索数据
var firebase = new FirebaseClient(url);
var Current = await firebase.Child("Member").OnceAsync<Member>();
但是我想要来自火灾基地的数据 从成员中选择*,其中IsActive = true,年龄&gt; 30
答案 0 :(得分:0)
在firebase中查询的子项不能超过子项,而且您使用的库不能做到这一点。如果您使用的平台是Mono.Android this库,则可以使用。
以及下面的解决方案代码
DatabaseReference myRef = database.GetReference("Member");
myRef.OrderByChild(mAge+"/IsActive").EqualTo(true).AddValueEventListener(this);
此外,您还需要根据需要更改数据库结构,以使该解决方案能够像这个时代一样工作
-Kr4RLvm2ObnbnRvWXeb-wEr
Age: "32"
Email: "samaaa@uil.gl"
IsActive: true
ManagerId: "170809sam@uil.gl"
MemberId: "170809sam@uil.gl"
Name: "Samiufgfgl alfgfgam"
-Kr4RLvmbnbn2ORvWXeb-wEr
Age: "34"
Email: "sasssm@uil.gl"
IsActive: true
ManagerId: "170809sam@uil.gl"
MemberId: "170809sam@uil.gl"
Name: "Samfgfgiul alam"
enter code here