title: Update only works sometimes
body: <p>When trying to update data in a NeDB database I'm getting <code>Field names cannot begin with the $ character</code> however it only happens after the second or third time updating the DB.</p>
  
  <p>Here's the code I'm using to update/insert data:</p>
  
  <pre><code>addNew: function(data) {
    var deferred = $q.defer(),
        query = {
          _id: data._id,
          title: data.title,
          year: data.year,
          genres: data.genres,
          poster: data.poster
        };
  
    db.update(query, { $addToSet: { episodes: data.episodes[0] } }, { upsert: true }, function(err, numReplaced, upsert) {
      if (!err) {
        var data = numReplaced + '/' + upsert;
        deferred.resolve(data);
      } else {
        deferred.reject(err);
      }
    });
  
    return deferred.promise;
  }
  </code></pre>
  
  <p><code>data.episodes[0]</code> looks like this:</p>
  
  <pre><code>{
    "number": 5,
    "season": 3,
    "title": "Kissed by Fire",
    "overview": "The Hound is judged by the gods. Jaime is judged by men. Jon proves himself. Robb is betrayed. Tyrion learns the cost of weddings.",
    "screen": "http://slurm.trakt.us/images/episodes/1395-3-5.80.jpg"
  }
  </code></pre>
  
  <p>The data in the DB I'm trying to update looks like this:</p>
  
  <pre><code>{
    "_id": "tt0944947",
    "title": "Game of Thrones",
    "year": 2011,
    "genres": "Drama, Fantasy, Adventure",
    "poster": "http://slurm.trakt.us/images/posters/1395-300.jpg",
    "episodes": [
      {
        "number": 10,
        "season": 4,
        "title": "The Children",
        "overview": "Circumstances change after an unexpected arrival from north of the Wall. Daenerys must face harsh realities. Bran learns more about his destiny. Tyrion sees the truth about his situation.",
        "screen": "http://slurm.trakt.us/images/episodes/1395-4-10.80.jpg"
      }
    ]
  }
  </code></pre>