-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
🔎 Search Terms
ObjectId,mongo
The problem
When using winston-mongodband logging mongo documents, the _id (and I think any property typed ObjectId) is transformed to {}
I encounter this when logging authenticated user through express-winston.
I use mongodb driver version 4.3.0
What version of Winston presents the issue?
v5.1.1
What version of Node are you using?
v18.17.1
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
No response
Additional information
While debugging the problem on my side, I figured that it is the helper cloneMeta that causes the issue : the test node instanceof ObjectID returns false whereas I guess it should return true
function cloneMeta(node, optParents) {
if (!((node !== null && typeof node === 'object') || typeof node === 'function')
|| (node instanceof ObjectID) || (node instanceof Buffer)) {
return node;
}
// ...
}Metadata
Metadata
Assignees
Labels
No labels