title: Fetching data using limitoLast returns null using endAt()
body: <p>I wanted to implement infinite scroll to load more data in my app. I wanted to fetch the data from latest to oldest i.e from bottom to top , so I have used <code>limiToLast()</code></p>
  
  <p>I have followed <a href="https://stackoverflow.com/questions/35098894/implementing-infinite-scrolling-with-firebase#">Implementing Infinite Scrolling with Firebase?</a> to achieve this functionality.</p>
  
  <p>Here is my query function</p>
  
  <pre><code>var lastKey = '';
  var myData = [];
  
  async fetchData(){
      try{
          var snap = await firebase.database().ref(category).orderByKey().endAt(lastKey).limitToLast(5).once('value');
          console.log(snap);
          snap.forEach(childSnap =&gt; {
              myData.push(childSnap.val();
              lastKey = childSnap.key;
          });
      }catch(err){
          //handle errors
      }
  }
  </code></pre>
  
  <p>But the <code>snap</code> is null if I console.log it.
  what am I doing wrong?
  <strong>I want to fetch 5 items at a time from the bottom</strong>
  if I use the same code using <code>startAt()</code> and <code>limitToFirst()</code> to fetch 5 items at a time it works fine:</p>
  
  <pre><code>var lastKey = '';
  var myData = [];
  
  async fetchData(){
      try{
          var snap = await firebase.database().ref(category).orderByKey().startAt(lastKey).limitToFirst(5).once('value');
          snap.forEach(childSnap =&gt; {
              myData.push(childSnap.val();
              lastKey = childSnap.key;
          });
      }catch(err){
          //handle errors
      }
  }
  </code></pre>