title: "Function DocumentReference.set() called with invalid data. Unsupported field value: a custom object" Error on adding data to doc?
body: <p>I am using angular with firebase and was trying to add data to my firestore collection using the below code: But i keep getting the error:</p>
  <pre><code>ERROR FirebaseError: Function DocumentReference.set() called with invalid data. Unsupported field value: a custom object (found in document web_record_tab_test/Z7zP7Tze1OwZfPkFKJph
  </code></pre>
  <p>I have tried the different answers given on another stackoverflow question but could not fina a solution to this. Here is my code:</p>
  <pre><code>let dataArray=dataAppFormat.map((obj)=&gt; {return Object.assign({}, obj)});
  let data={
    data: dataArray,//.map((obj)=&gt; {return Object.assign({}, obj)}),
    load: &quot;updated&quot;,
    type:&quot;RichTextBlock&quot;
  };
  let ref=this.firestore.collection('web_record_tab_test');
  ref.doc().set(data).then(function() {
    console.log(&quot;Document successfully written!&quot;);
  </code></pre>
  <p>Here dataAppFormat is an array which i have created into an array of JS objects and made a Js object and tried to add it into the document. Any suggestions on where i may be going wrong?</p>