How to make a Cloud Firestone query with a limit from and to?

0

Good community, I'm doing a Query in Firebase Firestone on android and I have found that I can not do a query with a limit from and even, what SQL would be limit 0.5 for example, looking at the documentation really not counting that give solution to this problem, so I come here to see if you have any idea of how I can do it, the idea is to go from 5 to 5. Here I leave the code, each time the user clicks on a button, a counter is increased and that is where the limit does. Greetings and thanks:

 db.collection("incidencias").whereEqualTo("activa",true).orderBy("t_stamp", Query.Direction.DESCENDING).limit(vez+5).get()
            .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
                @Override
                public void onComplete(@NonNull Task<QuerySnapshot> task) {
                    ArrayList<DocumentSnapshot> documentos= (ArrayList<DocumentSnapshot>) task.getResult().getDocuments();

                    for(int i=0; i<documentos.size(); i++){
                        DocumentSnapshot datos=documentos.get(i);
                        IncidenciaItem incidenciaItem=new IncidenciaItem(datos.getString("titulo"),
                                datos.getDate("t_stamp"),datos.getString("usuario"),datos.getString("descripcion"),
                                datos.getString("img1"),datos.getString("img2"),datos.getString("img3"),
                                datos.getString("direccion"),datos.getGeoPoint("coordenadas"),String.valueOf(datos.getId()),
                                datos.getBoolean("activa"));

                        adaptador.anadirElementos(incidenciaItem);

                    }

                    adaptador.notificarCambio();
                    cargaLista(true);

                }
            });
    
asked by Adrián Garrido Blázquez 12.11.2017 в 20:37
source

0 answers