title: How to use firestore emulator from client
body: <p>I want to test locally my firebase functions.
  These functions make firestore queries.</p>
  
  <p>So i start the emulator <code>firebase emulators:start</code> and in my client i use <code>firebase.functions().useFunctionsEmulator('http://localhost:5001')</code>.</p>
  
  <p>My functions work well when i call them in my client. I can read/write data inside the firestore emulator.</p>
  
  <p>The problem :</p>
  
  <p>I want to read the firestore emulator data directly inside my client, like :</p>
  
  <pre><code>firebase.firestore().collection('tests').get().then(tests =&gt; {
      console.log( tests.docs.map(test=&gt;test.map) )
  })
  </code></pre>
  
  <p>but i can't find how to set the firestore emulator inside my client.</p>
  
  <p>here what i tried:</p>
  
  <p>1) Firestore setting</p>
  
  <pre><code>firebase.firestore().settings({
      host:'http://localhost:8080',
      ssl:false
  })
  </code></pre>
  
  <p>result :</p>
  
  <p>i get <code>@firebase/firestore: Firestore (6.3.5): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.</code> inside my client console.</p>
  
  <p>The http request returns 'Not found'</p>
  
  <p>2) Set the emulator url inside my firebaseConfig</p>
  
  <pre><code>var firebaseConfig = {
      // ...
      databaseURL: "http://localhost:8080",
      // ...
  }
  
  firebase.initializeApp(firebaseConfig)
  
  </code></pre>
  
  <p>in this case, the remote server (<a href="https://firestore.googleapis.com." rel="noreferrer">https://firestore.googleapis.com.</a>.) is requested.</p>
  
  <p>So i want to setup one of these two cases :</p>
  
  <p>1) Using the remote firestore inside my functions emulators</p>
  
  <p>OR</p>
  
  <p>2) Using the local firestore emulator inside my client code.</p>
  
  <p>Anyone has already done this ?</p>