Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!