This is my code:
if (subTasks.ready()) {
for (let _id in Meteor.user().profile.saved.ids) {
let found = TasksDB.findOne({_id});
}
Thing is, “found” always returns undefined for some reason. I can use ‘findOne’ in other components, and the code is the same; I wait til the database is ready, then I query.
I can use TasksDB.find({}).fetch();
and it will show me everything in the database, but I can’t seem to use findOne. Any reason why?
I also tried TasksDB.findOne({_id: new Meteor.});
but all I get is this error:
Invalid hexadecimal string for creating an ObjectID
So it would seem that I’m not using MeteorIDs in my database, but rather strings as IDs.
Help will be appreciated, thanks!