8000 FIX: TS Types MongoDBConnectionOptions by victor-solvethex · Pull Request #190 · winstonjs/winston-mongodb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

FIX: TS Types MongoDBConnectionOptions #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

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
0