首页 > 解决方案 > Logcat 显示创建索引的链接,即使它已创建

问题描述

String[] group = {"A+", "B+", "O+", "AB+", "A-", "O-", "B-", "AB-"};
    String[] child = {"19", "18", "17", "16", "15"};
      CollectionReference collectionReference;
    ...................................................
    .....................................................
     @Override
    protected void onCreate(Bundle savedInstanceState) {
       ....................................
        groupPosition = intent.getIntExtra("groupPosition", 0);
        childPosition = intent.getIntExtra("childPosition", 0);
      .....................
        getData1();
       ............................
    }
    private void getData1() {
            collectionReference = db.collection(group[groupPosition]);
           collectionReference.whereEqualTo("batch", child[childPosition])
                   .whereEqualTo("status", "Resident").whereGreaterThan("days",120).addSnapshotListener(this, new EventListener<QuerySnapshot>() {
               @Override
               public void onEvent(@Nullable QuerySnapshot queryDocumentSnapshots, @Nullable FirebaseFirestoreException e) {

                   if(e!=null){
                       Log.d("Shuvo5", "onEvent: "+e);
                   }
                  ............................

我是安卓新手。在使用 firebase firestore 时,我需要构建三个字段的查询。我在 logcat 消息的链接之后创建了索引。但是再次构建代码会显示相同的消息。这个没看懂,谁能解释一下?

这是错误消息:

错误信息

这是数据库:

数据库

标签: androidandroid-studiogoogle-cloud-firestore

解决方案


推荐阅读