Skip to content

Comments

FIX: TS Types MongoDBConnectionOptions#190

Closed
victor-solvethex wants to merge 1 commit intowinstonjs:masterfrom
victor-solvethex:master
Closed

FIX: TS Types MongoDBConnectionOptions#190
victor-solvethex wants to merge 1 commit intowinstonjs:masterfrom
victor-solvethex:master

Conversation

@victor-solvethex
Copy link

@victor-solvethex victor-solvethex commented Mar 24, 2021

MongoDBConnectionOptions needs to extend the interface StreamTransportOptions so it can use the common transporter options such as 'format'

@janvasiljevic
Copy link

I had the same issue and thought this would fix it but it didn't. What worked for me, was importing Logform and then manually adding a new property, like this:

diff --git a/node_modules/winston-mongodb/lib/winston-mongodb.d.ts b/node_modules/winston-mongodb/lib/winston-mongodb.d.ts
index 32418cd..3fdb9d0 100644
--- a/node_modules/winston-mongodb/lib/winston-mongodb.d.ts
+++ b/node_modules/winston-mongodb/lib/winston-mongodb.d.ts
@@ -3,7 +3,7 @@
 // Definitions by: miton18 <https://github.com/miton18>, blove <https://github.com/blove>,
 // Balazs Mocsai <https://github.com/mbale>
 
-import { transports } from "winston";
+import { transports, Logform } from "winston";
 import { MongoDBTransportInstance, MongoDBConnectionOptions } from 'winston-mongodb';
 
 /**
@@ -141,6 +141,8 @@ declare module 'winston-mongodb' {
         * @memberof MongoDBConnectionOptions
         */
        expireAfterSeconds?: number;
+
+       format?: Logform.Format;
     }
     
     const MongoDB: MongoDBTransportInstance;

@yurijmikhalevich
Copy link
Member

@victor-solvethex, @janvasiljevic, the fix for format support was released in v5.1.1. Can you, please, check whether it is resolved for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants