title: How do I paginate with Cloud Firestore?
body: <p>I need to get 50 docs more messages from Cloud Firestore when I click on load more messages button in react-native.</p>
  
  <p>Here is in the below my code get 50 docs when I open up my application, but not all messages.</p>
  
  <pre><code>getMessagesFrom(usr){
      return db.collection("ppl/" + usr + "/messages/").orderBy("createdAt", "desc").limit(50).get().then(snapshot =&gt; {
          this.docs = snapshot.docs;
          let l = this.docs.length;
          for (let i = 0; i &lt; l; i++) {
              this.dblid = this.state.myId + usr;
              if (this.msgObj[this.dblid] === undefined) {
                  this.msgObj[this.dblid] = [this.docs[i].data()];
              } else {
                  this.msgObj[this.dblid] = [...this.msgObj[this.dblid], this.docs[i].data()]
              }
              if (i === l - 1) {
                  return this.msgObj;
              }
          }
          return false;
      });
  }
  </code></pre>
  
  <p>My Expectation is getting 50 docs more by clicking on more messages button.</p>