title: Batched write to Firebase Cloud Firestore failed due to wrong type
body: <p>I'm trying to execute a batched write to my database. However there seems to be a problem with <code>data[]</code> because I get this error:</p>
  <pre><code>FirebaseError: Expected type 't', but it was: a custom e object
  </code></pre>
  <p><strong>The Code:</strong></p>
  <pre><code>&lt;template&gt;
    &lt;div&gt;
      &lt;v-btn @click=&quot;setData()&quot;&gt;
        Write to Firestore
      &lt;/v-btn&gt;
      &lt;router-view/&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
   import { db } from '@/firebase'
  
  export default {
    methods: {
      setData() {
        
      var data = 
        [
          { 
            'title':'Ipsum lorem',
            'description':'Some text...',
            'color':'#03A9F4',
            'meta': 
              { 
                'docID':'',
                'createdBy':'', 
              }
          },
          { 
            'title':'Loren ipsum',
            'description':'Some more text...',
            'color':'#06A1F3',
            'meta': 
              { 
                'docID':'',
                'createdBy':'', 
              }
          }
        ]
  
        var batch = db.batch()
        data.forEach((doc) =&gt; {
          var dbRef = db.collection('teams').doc('team01').collection('templates')
          batch.set(dbRef, doc)
        })
        batch.commit().then(function() {
          return console.log(&quot;done&quot;)
        });
      }
    }
  }
  &lt;/script&gt;
  </code></pre>
  <p>In my file <code>data[]</code> contains more objects than shown here. They are below the limit of 500. <em>This is done in my Vue.js app using Vuetify.</em></p>
  <ol>
  <li><strong>How can I solve this problem?</strong></li>
  <li><strong>How can I add the id/reference of each document created and put it in <code>meta.docID</code>?</strong> I can't get this to work with batched writes.</li>
  </ol>
  <p>Any help is appreciated, thank you!</p>