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

156
Vistas
Firestore query documents startsWith a specific character

Is it possible to query a firestore collection to get all document that starts with a specific character? For example if I have a collection "Items" that contains:

enter image description here

I want for example only the document starting with I I don't know how modify the query , the method charAt[0] is not recognized:

return itemRef
      .doc(this.itemsId)
      .collection("october")
      .where(firebase.firestore.FieldPath.documentId().charAt[0], "==", randomChar)
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

From the top of my head, if interested in the letter "I":

var lower = 'I';
var upper = String.fromCharCode(lower.codeUnitAt(0) + 1);

itemRef
      .doc(this.itemsId)
      .collection("october")
      .where(firebase.firestore.FieldPath.documentId() ">=", lower)
      .where(firebase.firestore.FieldPath.documentId() "<", upper)

Not sure, what happens in case of the letter Z.

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