After Running this :
mcollection.find({“id”:“1”}).toArray();
Output :
[
{
"_id": {
"$oid": "606aa80e929a618584d2758b"
},
"id": "1",
"tid": "1",
"cid": "1",
"title": "What is Time Complexity",
"description": "So, the time complexity is the number of operations an algorithm performs to complete its task (considering that each operation takes the same amount of time).",
"image": "https://i.pinimg.com/originals/af/e4/0b/afe40bd0ee0a6b0e34daacd74078391e.jpg",
"author": "Hanry Kon"
}
]
I want same output based on ObjectId as Input
like :
mcollection.find({“_id”:ObjectId(“606aa80e929a618584d2758b”)}).toArray();
Error after Running this Code:
> error:
ReferenceError: 'ObjectId' is not defined
> trace:
ReferenceError: 'ObjectId' is not defined
at exports (function.js:28:43(28))
at function_wrapper.js:3:34(21)
at <eval>:11:8(17)
at <eval>:2:15(7)
How can i do that By Using MongoDB Webhook