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

265
Vistas
Firestore duplicate verification conditions

My Firestore database looks like this

enter image description here

For documents I use dynamic IDs. I do not use the user ID in the path, it is stored in the field. The fields have the values user and active.

How can I prevent adding new entries if, for example, the user 37870283 already has an active = true?

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

0

There is no way to ensure the uniqueness of a field value in Firestore security rules. The only ways to ensure uniqueness are:

  1. Use the thing that needs to be unique as the document ID.
  2. Perform all writes from a single, trusted process (like Cloud Functions), and use transactions there.

Also see:

  • Cloud Firestore: Enforcing Unique User Names
  • Prevent duplicate entries in Firestore rules not working
  • Firestore security rule to check if character username already exists

And more from this list

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