title: Firestore navigation for onUpdate and shuffle an array
body: <p>I have this Firebase structure:
  <a href="https://i.stack.imgur.com/F43Ap.png" rel="nofollow noreferrer">Firebase Structure</a>.
  Then I have a function in my Code, which adds a map called &quot;set&quot;.
  My Structure is looking like this after: <a href="https://i.stack.imgur.com/sZKpu.png" rel="nofollow noreferrer">New structure</a>.</p>
  <p>Now i want an onUpdate Firebase function, which is called after the map &quot;set&quot; is added in any document.
  This function should shuffle my &quot;question&quot; array.
  I tried something like this:</p>
  <pre><code> exports.shuffleSet = functions.firestore
      .document('duell/{duell_id}/set/questions')
      .onUpdate((change, context) =&gt; {
    
        const data = change.after.data();
        const previousData = change.before.data();
  
        if (data.name == previousData.name) {
          return null;
        }
  //shuffle code here
      });
  </code></pre>
  <p>But Im not sure if <code>.document('duell/{duell_id}/set/questions')</code> is the correct way to  navigate to the question array. And at the beginning the &quot;set&quot; is not even existing as explained at the top.</p>
  <p>How do I navigate to the question array correctly, that I can pull it &amp; update it shuffled?</p>