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

189
Views
can someone help me add a collection to my firebase database?

hey ive been working with a firebase database recently and im trying to add something to the data base with user input but its not working, it keeps throwing me the error: "Function CollectionReference.doc() requires its first argument to be of type non-empty string, but it was: undefined"

here is some of my code

const handleAddChannel = () => {
    const channelName = prompt("Enter a new channel name")

    if (channelName) {
        db.collection('Servers').doc(ServerId).collection('name').add({
            channelName: channelName
        })
    }
}

can anyone help? im trying to add a collection (just calling it name for simplicity)

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!