title: Cloud Firestore document add gives error "Value for argument "data" is not a valid Firestore document. Cannot use "undefined" as a Firestore value"
body: <p>I'm working on a react project and this is my very first react project. This code is deployed successfully. But get some errors while testing with postman. I "post" the "createScream" functions's URL and send it. then I got this errors.</p>
  
  <p>Any help towards resolution is highly appreciated. I'm new to react world. Here's my index.json file</p>
  
  <pre><code>const functions = require('firebase-functions');
  const admin = require('firebase-admin');
  
  admin.initializeApp();
  
  // // Create and Deploy Your First Cloud Functions
  // // https://firebase.google.com/docs/functions/write-firebase-functions
  //
   exports.helloWorld = functions.https.onRequest((request, response) =&gt; {
    response.send("Hello world");
   });
  
   exports.getScreams = functions.https.onRequest((req, res)=&gt; {
       admin
       .firestore()
       .collection('screams')
       .get()
       .then(data=&gt;{
           let screams =[];
           data.forEach(doc =&gt;{
               screams.push(doc.data());
           });
           return res.json(screams);
       })
       .catch((err)=&gt; console.error(err));
   });
  
   exports.createScream = functions.https.onRequest((req, res)=&gt; {
      const newScream = {
          body:req.body.body,
          userHandle: req.body.userHandle,
          createdAt: admin.firestore.Timestamp.fromDate(new Date())
      };
  
      admin
      .firestore()
      .collection('screams')
      .add(newScream)
      .then((doc)=&gt;{
          res.json({message:'document ${doc.id} created successfully'});
      })
      .catch((err)=&gt;{
          res.status(500).json({ error:'something went wrong'});
          console.error(err);
  
      });
  </code></pre>
  
  <p>I got this error message</p>
  
  <pre><code>Error: Value for argument "data" is not a valid Firestore document. Cannot use "undefined" as a Firestore value (found in field body).
      at Object.validateUserInput (E:\survival\TF2\functions\node_modules\@google-cloud\firestore\build\src\serializer.js: 273: 15)
      at Object.validateDocumentData (E:\survival\TF2\functions\node_modules\@google-cloud\firestore\build\src\write-batch.js: 611: 22)
      at CollectionReference.add (E:\survival\TF2\functions\node_modules\@google-cloud\firestore\build\src\reference.js: 1765: 23)
      at exports.createScream.functions.https.onRequest (E:\survival\TF2\functions\index.js: 38: 6)
      at Run (C:\Users\User\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js: 608: 20)
      at C:\Users\User\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js: 582: 19
      at Generator.next (&lt;anonymous&gt;)
      at C:\Users\User\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js: 7: 71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (C:\Users\User\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js: 3: 12)
  </code></pre>