title: Syntax to update a Firestore document by adding a new field with a "dynamic name" (React-Redux)
body: <p>I am trying to update a Firestore document by adding a new &quot;Question Array&quot; (containing the details of the question inside of the array).</p>
  <p>I'd like to name of this new &quot;field&quot; inside the firestore document to follow a consistent naming convention whose value changes dynamicially with the number of question arrays in the document.</p>
  <p>i.e. Adding adding the 5th question array in the document would take the current number of questions in the document (4) and add 1 to it (making 5).  Then it would attach this value to the actual name of the new field being created (i.e. 'question/+(5)/ = [question details]. The code below might clarify what I'm trying to accomplish.</p>
  <pre><code>export const createFlashcardQuestion = (state) =&gt; {
  
      return (dispatch, getState, { getFirebase, getFirestore}) =&gt; {
  
           (...)
      
          const numberOfQuestions = state.numberOfQuestions;    &lt;--- THIS IS THE VALUE I WANT TO REPLACE THE # with
  
          # = numberOfQuestions;                                &lt;----- Placed here for clarity that this is the value trying to be ammended to the question array name.
  
          firestore.collection(...PATH BLAH BLAH...).update({   &lt;----- I SIMPLIFIED THE PATH JUST FOR THIS QUESTION
              numberOfQuestions: numberOfQuestions,             &lt;---- THIS IS THE NEW # OF QUESTIONS
              lectureUpdatedAt: new Date(),
              question#: [state],                               &lt;-------- THIS IS THE LINE I AM STRUGGLING. I want the &quot;#&quot; to somehow equal the interger value found in &quot;numberOfQuestions&quot;.
              
  
          }).then(() =&gt; {
  
              (...Dispatch and Thunk Mumbo Jumbo...)
  
      
  };
  </code></pre>