grahamearley / FirestoreGoogleAppsScript

A Google Apps Script library for accessing Google Cloud Firestore.
http://grahamearley.website/blog/2017/10/18/firestore-in-google-apps-script.html
MIT License
647 stars 109 forks source link

Feature Request: startAt(), startAfter(), endAt() etc. methods for queries #77

Closed robase closed 4 years ago

robase commented 4 years ago

The inclusion of these methods would be a lifesaver if possible:

https://firebase.google.com/docs/reference/js/firebase.firestore.CollectionReference#start-at https://firebase.google.com/docs/reference/js/firebase.firestore.CollectionReference#start-after https://firebase.google.com/docs/reference/js/firebase.firestore.CollectionReference#end-at

LaughDonor commented 4 years ago

This functionality already existed by combining the .offset and .limit query functions.

However, I created a PR so that you can use the .range(start, end) query function to to combine the two if needed. As far as the "startAfter" and "endBefore", they are the same, just off by one. You should be able to make your adjustments in the code before using these functions.