|
@@ -54,11 +54,17 @@ mongoose.plugin(schema => {
|
|
|
|
|
|
|
|
mongoose.Promise = global.Promise
|
|
mongoose.Promise = global.Promise
|
|
|
|
|
|
|
|
|
|
+async function getMongoClient() {
|
|
|
|
|
+ const mongooseInstance = await connectionPromise
|
|
|
|
|
+ return mongooseInstance.connection.getClient()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function getNativeDb() {
|
|
async function getNativeDb() {
|
|
|
const mongooseInstance = await connectionPromise
|
|
const mongooseInstance = await connectionPromise
|
|
|
return mongooseInstance.connection.db
|
|
return mongooseInstance.connection.db
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+mongoose.getMongoClient = getMongoClient
|
|
|
mongoose.getNativeDb = getNativeDb
|
|
mongoose.getNativeDb = getNativeDb
|
|
|
mongoose.connectionPromise = connectionPromise
|
|
mongoose.connectionPromise = connectionPromise
|
|
|
|
|
|