Hi All,
Hoping for some extra pairs of eyes as to why the results from my find is coming back with an empty array.
Here is my code:
this.camp = Camps.findOne(this.campId);
if (this.camp.camperIds) {
console.log("this.camp.camperIds: ", this.camp.camperIds);
/// console.log >>> this.camp.camperIds: ["aXPMKtJeCZstLh3yZ", "NXpwF2cwucRMKn4hN"]
this.campers = Campers.find({_id: { $in: this.camp.camperIds }}).fetch();
console.log("this.campers", this.campers);
/// console.log >>> this.campers []
}
In the mongo shell I run this command:
db.campers.find({_id:{$in:["aXPMKtJeCZstLh3yZ", "NXpwF2cwucRMKn4hN"]}})
This returns me the two documents I was expecting. Any ideas as to what I’m doing wrong?