let theContact;
if (theContactMatch.contact_id.length === 24) {
console.log("[RTMS_Distributions] theContactMatch.contact_id is 24 characters long");
theContact = await Contacts.findOneAsync({ _id: theContactMatch.contact_id._str });
} else {
console.log("[RTMS_Distributions] theContactMatch.contact_id is not 24 characters long");
theContact = await Contacts.findOneAsync({ _id: theContactMatch.contact_id });
}
Iām losing my marbles man, I had to do a bulk import cuz I allow CSV uploads which contain thousands of records.
Now their _id is a freaking object in mongo.
How the hell do I get a record by an _id that is AN OBJECT