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

101
Views
How to add sub collection with documents into parent document in firestore using react.js?

I just want to save my data into firestore. but according to data structure, I have to create new collection into document. but my js are not working. Could you check it? Is it possible?

/*
   po   : parent collection
     po-{}: parent document
      items: sub collection
        item-${} : sub document
*/


items.map(async(item) => {
  await setDoc(doc(firestore, "po", `po-${po_number}`,'items', `item-${item.item_id}` ), {
    id:       item.item_id,
    quantity: item.quantity,
    received: item.received,
    rate:     item.rate,
    amount:   item.rate * item.quantity
  });
})
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!