title: Small error in MongoDB update query
body: <p>I've been trying to update/add some variables to a set in MongoDB using Mongoose for awhile now but I just can't find the small error I'm having.</p>
  
  <p>Can somebody see the error in my code, it's been driving me crazy and I haven't found the error and I'm in crunch time right now.</p>
  
  <pre><code>module.exports.findAndSubmitAttempt = function(annotationDate, annotationModule, annotationTitle, date, submission, studentID) {
      var query = {date:annotationDate,title:annotationTitle,module:annotationModule};    
      var updating = ClassAssignments.update(query, { $addToSet: {submissions: [ studentID, submission, date ] } }, {upsert:true}, function(err, doc) {
          if(err){
              console.log("Something went wrong uploading the submission");
          }
          console.log(doc);//This means everything works perfectly
      })
      return query;
  }
  </code></pre>