Skip to content

Commit 28fd1b6

Browse files
authored
Merge pull request #12948 from simon-abbott/patch
fix: export mongodb types more robustly
2 parents 23b95c9 + 4220887 commit 28fd1b6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/types/mongo.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import * as mongoose from 'mongoose';
2+
import { expectType } from 'tsd';
3+
4+
import GridFSBucket = mongoose.mongo.GridFSBucket;

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ declare module 'mongoose' {
109109
export function setDriver(driver: any): Mongoose;
110110

111111
/** The node-mongodb-native driver Mongoose uses. */
112-
export const mongo: typeof mongodb;
112+
export { mongodb as mongo };
113113

114114
/** Declares a global plugin executed on all Schemas. */
115115
export function plugin(fn: (schema: Schema, opts?: any) => void, opts?: any): Mongoose;

0 commit comments

Comments
 (0)