title: How to read React native Firebase Cloud firestore Data
body: <p>I started my Creating my react native android App using realtime database but later realised that i could'nt carry out some queries(like where) so i changed to cloud firestore but i have found trouble changing code meant for realtime database to cloud firestore. I have this for the real time database which works well</p>
  <pre><code>firebase.database().ref('/users').on('value', (snapshot) =&gt; {
        let data = snapshot.val();
        let items = Object.values(data);
        this.setState({items});
     }).catch(function(error) {
           var errorCode = error.code;
           var errorMessage = error.message;            
             this.setState({ errorMessage: errorMessage })            
         });
  </code></pre>
  <p>I have tried to yield the code above in cloud firestore as shown below but doesn't work(a typeerror pops up and states that snapshot.val is not a function).</p>
  <pre><code>firebase.firestore().collection('users').get().then((snapshot)=&gt;{              
          let data = snapshot.val();
          let items = Object.values(data);
          this.setState({items});
       }).catch(function(error) {
           var errorCode = error.code;
           var errorMessage = error.message;            
             this.setState({ errorMessage: errorMessage })            
         });
  </code></pre>
  <p>This is in my database project
  <a href="https://i.stack.imgur.com/1LHF2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1LHF2.png" alt="cloud firestore instance" /></a>
  How can i yield working corresponding cloud firestore code?</p>