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

273
Views
Uncaught (in promise) TypeError: _firebase__WEBPACK_IMPORTED_MODULE_7__.db.collection is not a function

I want to add usersOrderInfo collection inside users document.I tried this way:

db
.collection('shopDB')
.doc(user.uid)
.collection("userOrderInfo")
.doc(paymentInfo.id)
.set({
orders:basket,created:paymentIntent.created},{merge:true})

But this throw an error :

Uncaught (in promise) TypeError: _firebase__WEBPACK_IMPORTED_MODULE_7__.db.collection is not a function

I am using firebase version 10.5.0

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The set() takes data of document as parameter. Try refactoring the code as shown below:

db
.collection('shopDB')
.doc(user.uid)
.collection("userOrderInfo")
.doc(paymentInfo.id)
.set(DOC_DATA)

Also do ensure that no field is undefined.

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!