title: Firebase database update is removing child data
body: <p>I am writing an event list app, It has a hierarchy of Event > Part > Step.  After I've created an event, I can "go into" the event and see the list of "parts" which contain a list of "steps".</p>
  
  <p>The way I've structured my database is so that I have an object sorted by user ID to show the events and its details, then if I click on that event, I go into it, now looking at a <code>parts</code> object.  The parts object looks something like this:</p>
  
  <pre><code>parts:
      eventID1:
          partID1:
              startDateTime:value,
              endDateTime:value,
              title:value,
              ...
          partID2:
              startDateTime:value,
              endDateTime:value,
              title:value,
              ...
          etc.
  </code></pre>
  
  <p>This works well, I pull all parts per event ID.  The problem comes with steps.  When I add a step to a part, I put it in two places (using <code>update</code>); one in a steps table and one in the part itself, adding a new key:value to the <code>part</code></p>
  
  <p>the steps object looks like this:</p>
  
  <pre><code>steps:
      eventID1:
          partID1:
              stepID1:
                  title:value,
                  startDateTime:value,
                  etc.
              stepID2:
                  title:value,
                  startDateTime:value,
                  etc.
  </code></pre>
  
  <p>And finally (the problem area) the part object is updated to look like this:</p>
  
  <pre><code>parts:
      eventID1:
          partID1:
              startDateTime:value,
              endDateTime:value,
              title:value,
              ...
              steps:
                  stepID1:
                      title:value,
                      startDateTime:value,
                      etc.
                  stepID2:
                      title:value,
                      startDateTime:value,
                      etc.
          partID2:
              startDateTime:value,
              endDateTime:value,
              title:value,
              ...
          etc.
  </code></pre>
  
  <p>I've added the steps within the parts above (again, using <code>update</code>).  The problem is now when I edit the part's title or date, It returns as updated but there are no steps within.  It erases the steps.  </p>
  
  <p>Each <code>event</code>, <code>part</code> and <code>step</code> have the same structure, so I've combined all of this into a single function (using ionic 3/angular4)</p>
  
  <pre><code>  update(action, type, eid, pid, sid, title, location, startDateTime) {
      console.log("Firebase Database Receiving: ", action, type, eid, pid, sid, title, location, startDateTime);
      let key = (action === "add") ? this.ref.push().key : null;
      console.log(key);
      let update;
      let object = {
        startDateTime: startDateTime,
        startDateTimeEpoch:  moment(startDateTime).format("X"),
        endDateTime: startDateTime,
        endDateTimeEpoch:  moment(startDateTime).format("X"),
        title: title,
        type: type,
        roles: {
          [this.firebaseAuthentication.uid]: "admin",
        },
        location: {
          title: location,
          street: '',
          city: '',
          state: '',
          zip: '',
          timeZone: ''
        },
      };
      if(type === "events"){
        key = (key) ? key : eid;
        if(action !== "delete") {
          update = {
            ['events/' + key]: object,
            ['roles/' + this.firebaseAuthentication.uid + '/' + key]: object
          }
        } else {
          console.log("delete event", key);
          update = {
            ['events/' + key]: null,
            ['roles/' + this.firebaseAuthentication.uid + '/' + key]: null,
            ['parts/' + key]: null,
            ['steps/' + key]:null
          }
        }
      } else if(type === "parts") {
        key = (key) ? key : pid;
        if(action !== "delete") {
          update = {
  /************ . Here is the update object . ***********/
            ['parts/' + eid + '/' + key]: object
          }
        } else {
          update = {
            ['parts/' + eid + '/' + key]: null,
            ['steps/' + eid + '/' + key]: null
          }
        }
      } else if(type === "steps") {
        key = (key) ? key : sid;
        if(action !== "delete") {
          update = {
            ['parts/' + eid + '/' + pid + '/steps/' + key]: object,
            ['steps/' + eid + '/' + pid + '/' + key]: object
          }
        } else {
          update = {
            ['parts/' + eid + '/' + pid + '/steps/' + key]: null,
            ['steps/' + eid + '/' + pid + '/' + key]: null
          }
        }
      }
      console.log(object, update);
      return new Promise((resolve, reject) =&gt; {
  /**************** . Finally the actual update function ************/
        this.ref.update(update).then(success =&gt; {
          resolve(success);
        }, error =&gt; {
          reject(error);
        });
      });
    }
  </code></pre>
  
  <p>This basically iterates through, the specific <code>action/type</code> combination is <code>edit</code>/<code>part</code>.  </p>
  
  <p>From what I've read about firebase's <code>update()</code>, it should not be destructive to any data within the object that it's not touching.  This is acting like <code>set()</code> should, but I do not want that obviously.</p>
  
  <p>Any thoughts? Frank?</p>