I’m using the findOne
function on a MongoDB Atlas Function … I’m trying to match multiple data points but it doesn’t seem to match on these. I definitely have a document in my collection that matches however it always returns ``null`.
const matcher = await myCollection.findOne({
object_id: `${event.fullDocument.object_id}`,
user_id: `${event.fullDocument.user_id}`,
expiry: { $gt: new Date() }
});
Is there anything I’m doing wrong here? How can I get data back that matches these 3?
Thanks