I want to fetch the documents using createdAt filed in mongodb. Example i want to fetch the documents where today date is equal to createdAt.Attached is the screenshot. In the below case it should return 0.
I have tried using this but it is returning 1.
const todayAdded = await InventoryModel.find({
owner: address,
"createdAt" : {
$gte: new Date("2016-11-16").toISOString(),
$lte: new Date("2016-12-01").toISOString()
}
}).estimatedDocumentCount();