title: How to add sub collection with documents into parent document in firestore using react.js?
body: <p>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?</p>
  <pre><code>/*
     po   : parent collection
       po-{}: parent document
        items: sub collection
          item-${} : sub document
  */
  
  
  items.map(async(item) =&gt; {
    await setDoc(doc(firestore, &quot;po&quot;, `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
    });
  })
  </code></pre>