如何使用FirebaseDatabase进行查询?

时间:2016-10-14 12:48:36

标签: android firebase firebase-realtime-database

我的数据库看起来像这样 enter image description here

要获取项目我这样做:

        mFirebaseDatabase
                        .getReference("credits")
                        .orderByChild("regionId")
                        .equalTo(2607)
                        .addValueEventListener(new ValueEventListener() {
                    @Override
                    public void onDataChange(DataSnapshot dataSnapshot) {
                        List<Credit> creditList = new ArrayList<Credit>();

                        for (DataSnapshot postSnapshot : dataSnapshot.getChildren()) {
                        Credit credit = postSnapshot.getValue(Credit.class);
                        creditList.add(credit);
                         }
                    }
                });
  1. 如何查询“where regionId == 2607 OR regionId == 0”?
  2. 如何查询“where”requiredDocuments'.contains(“Passport”)“?

0 个答案:

没有答案