title: add document and subcolletion as batch write firebase and VUEJS
body: <p>I am trying to do batch write.
  My goal:</p>
  <ol>
  <li>First I want to write data which generate new collection with unique ID.</li>
  <li>Then I want to add to this unique collection a subcollection of list by running forEach.</li>
  </ol>
  <p>Current problem:</p>
  <ol>
  <li>I don't know how to get this unique ID which is generated when first batch runs which I then want to parse in second batch where I create subcollection.</li>
  <li>forEach doesn't work it only takes the last item from list orders.</li>
  </ol>
  <p>this is my current code, note I use VUEJS3 with Pinia and for Firebase Web version 9.</p>
  <pre><code>      orders: [
          {
            id: 'id1',
            product: 'yup',
            productivity: 'nothing',
            quantity: 'lot',
          },
          {
            id: 'id2',
            product: 'Smith',
            productivity: 'huge',
            quantity: 'few',
          },
        ],
  </code></pre>
  <pre><code>const batch = writeBatch(db);
  
  addOrderTest() {
    const storeAuth = useStoreAuth();
    const docRef = doc(collection(db, 'users', storeAuth.user.id, 'clients', 'punTa54ogJ6wLgRmAp4Y', 'ordera'))
  
    batch.set(docRef, {name: 'something'})
  
    // here I want to add list Orders in collection which I make above, but I don't know how to get this newId, and also forEach takes only last item from table //  
    const newId = docRef.id
    this.orders.forEach((order) =&gt; {batch.set(newId, order)})
  
  
    return batch.commit()
  }
  </code></pre>