mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 19:00:13 +01:00
🔧 refactor: Make MongoDB name optional in connection options
This commit is contained in:
parent
d7f4f8ef4a
commit
cffd66054e
2 changed files with 5 additions and 2 deletions
|
|
@ -27,7 +27,6 @@ async function connectDb() {
|
|||
if (!cached.promise || disconnected) {
|
||||
const opts = {
|
||||
bufferCommands: false,
|
||||
dbName: MONGO_DB_NAME,
|
||||
// useNewUrlParser: true,
|
||||
// useUnifiedTopology: true,
|
||||
// bufferMaxEntries: 0,
|
||||
|
|
@ -35,6 +34,10 @@ async function connectDb() {
|
|||
// useCreateIndex: true
|
||||
};
|
||||
|
||||
if (MONGO_DB_NAME) {
|
||||
opts.dbName = MONGO_DB_NAME;
|
||||
}
|
||||
|
||||
mongoose.set('strictQuery', true);
|
||||
cached.promise = mongoose.connect(MONGO_URI, opts).then((mongoose) => {
|
||||
return mongoose;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue