startAfter(snapshot.docs[snapshot.docs.length -1]);
is working perfectly but
endBefore(snapshot.docs[0]);
is not wor