title: How to get reference as string firestore
body: <p>I'm trying to get the &quot;RefNegocio&quot; value:
  <a href="https://i.stack.imgur.com/5mD3l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5mD3l.png" alt="Firestore" /></a></p>
  <p>I want it as a string so I can use it to do a query based on that info. If I try to read it like this(empleadoSeleccionado is where all the info is):</p>
  <pre><code>console.log(empleadoSeleccionado)
  </code></pre>
  <p>I get all the info but the ref. I get something like this.</p>
  <p><a href="https://i.stack.imgur.com/TnuU4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TnuU4.png" alt="Console log" /></a></p>
  <p>This is how I'm reading from firestore</p>
  <pre><code>useEffect(() =&gt; {
      database.collection('EmpleadosDev').get()
          .then(response =&gt; {
              const fetchedEmpleados = [];
              const emails = [];
              response.forEach(document =&gt; {
                  const fetchedEmpleado = {
                      id: document.id,
                      ...document.data()
                  };
                  fetchedEmpleados.push(fetchedEmpleado);
                  fetchedEmpleados.forEach(element =&gt; {
                      emails.push(element.Email)
                  });
                  if (!emails.includes(currentUser.email)) {
                      alert('Este usuario no tiene permisos de acceso. Serás redirigido al login');
                      firebase.auth().signOut();
                      throw BreakException;
                  } else {
                      setEmpleadoSeleccionado(fetchedEmpleados[emails.indexOf(currentUser.email)]) //Here I get the value I'm showing
                  }
              });
              setEmpleados(fetchedEmpleados);
          })
  
  }, [])
  
  useEffect(() =&gt; {
      if (empleadoSeleccionado !== undefined) {
          console.log(empleadoSeleccionado) //Here I'm printing it
      }
  
  }, [empleadoSeleccionado])
  </code></pre>