title: Firebase Firestore doesn't let me save new String to array via Cloud Function
body: <p>I'm trying to save a new String value to an Array in a document in Firebase Firestore via Cloud Function, this is the Source Code</p>
  <p>Note: values.raffleId is a String</p>
  <pre><code>exports.onRaffleSignupCreate = functions.firestore
  .document(&quot;posts/{postId}/raffleSignups/{signupId}&quot;)
  .onCreate(async (snapshot, context) =&gt; {
    const values = snapshot.data();
    console.log(values.raffleId);
    db.collection(&quot;users&quot;)
        .doc(values.userId)
        .update({&quot;signUps&quot;: admin
            .firestore
            .FieldValue
            .arrayUnion([values.raffleId])});
  });
  </code></pre>
  <p>It gives me this error:</p>
  <pre><code>onRaffleSignupCreate
  Error: Element at index 0 is not a valid array element. Nested arrays are not supported. at validateArrayElement (/workspace/node_modules/@google-cloud/firestore/build/src/field-value.js:427:15) at ArrayUnionTransform.validate (/workspace/node_modules/@google-cloud/firestore/build/src/field-value.js:354:13) at /workspace/node_modules/@google-cloud/firestore/build/src/document.js:809:56 at Map.forEach (&lt;anonymous&gt;) at DocumentTransform.validate (/workspace/node_modules/@google-cloud/firestore/build/src/document.js:809:25) at WriteBatch.update (/workspace/node_modules/@google-cloud/firestore/build/src/write-batch.js:379:19) at DocumentReference.update (/workspace/node_modules/@google-cloud/firestore/build/src/reference.js:387:14) at /workspace/lib/index.js:14:10 at cloudFunction (/workspace/node_modules/firebase-functions/lib/cloud-functions.js:134:23) at /layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/invoker.js:199:28
  </code></pre>
  <p>Has anyone else encountered this problem and knows how to fix it?</p>