title: Angularfire Update nested data
body: <p>I am using angularfire and firebase firestore database to save image data in a database. The saving works 100%.</p>
  
  <p>My data is nested like this :</p>
  
  <p>Images Collection</p>
  
  <ul>
  <li>galleryId
  
  <ul>
  <li>imageId 
  
  <ul>
  <li>name</li>
  <li>path</li>
  </ul></li>
  <li>imageId
  
  <ul>
  <li>name</li>
  <li>path</li>
  </ul></li>
  </ul></li>
  <li>galleryId
  
  <ul>
  <li>imageId
  
  <ul>
  <li>name</li>
  <li>path</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>Sometimes I need to update a specific image object in the database, however, when I try do update an image object / doc I get the following error:</p>
  
  <pre><code>Invalid document reference. Document references must have an even number of segments, but images/yuEXbpYWqE4AUfmRCxIu/JvLzEANRFlupuUxYXNii has 3
  </code></pre>
  
  <p>This is the code I user :</p>
  
  <pre><code>this.afs.doc('images'+'/'+galleryId+'/'+imageId+'/').update({"name": upload.name,"path": upload.url});
  </code></pre>
  
  <p>I have also tried :</p>
  
  <pre><code>this.afs.doc('images').collection(galleryId).doc(imageId).update({"name": upload.name,"path": upload.url});
  </code></pre>
  
  <p>and I have also tried :</p>
  
  <pre><code> this.afs.collection('images'+'/'+galleryId).doc(imageId).update({"name": upload.name,"path": upload.url});
  </code></pre>
  
  <p>and then I get a similar error, just referencing the collection this time :</p>
  
  <pre><code> Invalid collection reference. Collection references must have an odd number of segments, but images/AHcWODRgsespIExQnJae has 2
  </code></pre>
  
  <p>When I try to update other collections in my database it works fine, however, they are only nested 2 levels. It seems that when you have nested 3 levels there are issue.</p>
  
  <p>Please help</p>