mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #3099 from overleaf/em-mongoose-native-connection
Obtain the native Mongo connection from Mongoose GitOrigin-RevId: 496958b1fdda617ed9ed9389c648688479d7fef3
This commit is contained in:
parent
cce77cb237
commit
ef0235e156
1 changed files with 8 additions and 1 deletions
|
@ -13,7 +13,7 @@ if (
|
|||
)
|
||||
}
|
||||
|
||||
mongoose.connect(
|
||||
const connectionPromise = mongoose.connect(
|
||||
Settings.mongo.url,
|
||||
{
|
||||
poolSize: POOL_SIZE,
|
||||
|
@ -54,4 +54,11 @@ mongoose.plugin(schema => {
|
|||
|
||||
mongoose.Promise = global.Promise
|
||||
|
||||
async function getNativeDb() {
|
||||
const connection = await connectionPromise
|
||||
return connection.db
|
||||
}
|
||||
|
||||
mongoose.getNativeDb = getNativeDb
|
||||
|
||||
module.exports = mongoose
|
||||
|
|
Loading…
Reference in a new issue