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

81
Views
How to get all the documents with a different ID than the current one in Firestore

I want to get all the documents where the automatically assigned Firestore ID doesn't match the ID of my current user. The code I have is just an example but it doesn't work since the documents themself don't have an "ID" field.

database.collection("users").where("id", "!=", userId).get().then(data => {
  data.forEach(user => {
    if (user.data().username == editUsername.value) {
      alert("Username is taken")
      canBeEdited = false
    } else if (user.data().email == editEmail.value) {
      alert("Email is taken")
      canBeEdited = false
    }
  })
})
about 4 years ago · Juan Pablo Isaza
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!