title: Argument "options" is not a valid SetOptions error on Firestore
body: <p>I'm trying to copy my real time database contents to firestore. But I'm getting this error when I use the set function.</p>
  
  <pre><code>exports.copyPosts = functions.https.onRequest((req, res) =&gt; {
      var i = 0;
      var username;
      db.ref("feeds").child("all").limitToLast(2000).once("value", function (postSnap) {
          console.log(postSnap.numChildren());
          postSnap.forEach(function(topic){
                      i = i + 1;
                      console.log(topic.key);
                      firestore.collection("topics").doc("all").collection(i+"").set({
                          caption: topic.child("caption").val(),
                          time: topic.child("time").val(),
                          username: topic.child("username").val(),
                          category: topic.child("category").val(),
                          pic: topic.child("pic").val()
  
                      },function(error) {
                        if (error) {
                          alert("Data could not be saved." + error);
                        } else {
                          alert("Data saved successfully.");
                      }
                      });
  
                  if(postSnap.numChildren()==i){
                      res.contentType('application/json');
                      res.status(200).send("Success");
                  }
              });
          });
  
  });
  </code></pre>
  
  <p>Error Log</p>
  
  <blockquote>
    <p>Error: Argument "options" is not a valid SetOptions. Input is not an
    object.
        at exports.(anonymous function) (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/validate.js:86:15)
        at Object.exports.(anonymous function) [as isOptionalSetOptions] (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/validate.js:91:35)
        at WriteBatch.set (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/write-batch.js:268:14)
        at DocumentReference.set (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/reference.js:425:8)
        at /user_code/index.js:2172:47
        at /user_code/node_modules/firebase-admin/node_modules/@firebase/database/dist/cjs/src/api/DataSnapshot.js:126:20
        at LLRBNode.inorderTraversal (/user_code/node_modules/firebase-admin/node_modules/@firebase/database/dist/cjs/src/core/util/SortedMap.js:170:13)
        at LLRBNode.inorderTraversal (/user_code/node_modules/firebase-admin/node_modules/@firebase/database/dist/cjs/src/core/util/SortedMap.js:169:27)
        at LLRBNode.inorderTraversal (/user_code/node_modules/firebase-admin/node_modules/@firebase/database/dist/cjs/src/core/util/SortedMap.js:169:27)
        at LLRBNode.inorderTraversal (/user_code/node_modules/firebase-admin/node_modules/@firebase/database/dist/cjs/src/core/util/SortedMap.js:169:27)</p>
  </blockquote>