'Nodejs global Mongo default _id type for classic javascript
Hello I have found a solution how to make the default type for _ID MongoDB by @Tim_Hilt
dbo.collection<DocumentType>("my-collection").deleteOne({ _id: id }, (err, obj) => {
// ^^^ Note this type-definition!
dbo.collection<{ _id: string }>("my-collection").deleteOne({ _id: id }, (err, obj) => {
Question: how I can set globally type for _id in classic js (not TS)? I want that _id always will be string without wrap Object
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
