I want to test a few things that regards some data i have stored stored in a collection called exams. This is my code
Template.Examinations.events({
'click .reactive-table tr': function() {
Session.set('selectedPersonId', this._id);
var cursor = Exam.findOne(Session.get("selectedPersonId"));
if (!cursor.count()) return;
cursor.forEach(function(doc){
console.log(doc._id);
});
//Uncaught TypeError: cursor.count is not a function
},
});
Everytime i run the code by clicking a row,i get the error
//Uncaught TypeError: cursor.count is not a function
Why am i getting this error?.