Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

175
Vistas
Firestore React get document by URL

I have a question about the operation that can be used with firestore

I have a table displaying a list of documents. (url: localhost/dashboard/users)

When I click on a document in the list, I want to be redirected to a details page. (url: localhost/dashboard/user/1)

Except that with firestore, my url is represented in this form: (url: localhost/dashboard/user/MuVsCLALiQPZuxnV3yyQ)

How do you get a details page with a "clean" URL.

Knowing that I want to be able to display the details of a user by going through the complete url and without necessarily going through the list

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If by "clean" you mean integers or shorter UIDs then you'll can store a field in user's Firestore document e.g. {shortUid: 1} (or set that short UID as document ID at first place) and then query based on the ID:

const userId = getIdFromURL();

const user = await getDocs(collection(db, "users"), where("shortUid", "==", userId))

Using sequential IDs is not recommended with NoSQL databases like Firestore so do checkout Firestore Best Practices

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda