MongoDB (mongoose) – find by ObjectId returns empty result
Trying to find a document by ObjectId in mongoose. The query returns an empty result but when applying the same query in the "MongoDB Compass" - it returns the document. const mongoose = require("mongoose"); await CollectionModel.find({ "_id": new mongoose.Types.ObjectId(DOCUMENT_ID)}); What…