Mabeh Al-Zuq Yadeek
Mabeh Al-Zuq Yadeek

Reputation: 84

Getting undefined database errors in console after using Meteor reset to reset my DB

Here are the condensed cliffs:

Any ideas what could cause these errors?

Code for "inserResults":

insertResults: function(data, userIP){
  if(Results.findOne({"data.id": data.questionId})){
    Results.update({"data.id": data.questionId}, {$push: {"data.choices": data.choices[0], "data.ip": userIP, "data.timeTracker": data.timeTracker[0]}, $set: {"data.lastResponse": data.lastResponse}});
  } else{
  Results.insert({data}, function(error, result){
    if(!error){
      Results.update({"data.id": data.questionId}, {$push: {"data.ip": userIP}});
    }
  });
  }
}

Upvotes: 0

Views: 25

Answers (1)

Rob van Dijk
Rob van Dijk

Reputation: 722

Looks like you are passing an undefined object called 'Results' to the method 'insertResults' which I'm assuming puts them into the database? Have you tried checking the invocations of this method and could you maybe post the method in question?

Upvotes: 1

Related Questions