Re-patch db connection
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
eecafee7cf
commit
4d2262f349
@ -5,11 +5,15 @@ const dbPass = process.env.OWL_DB_PASS || "twittwoo";
|
|||||||
const dbName = process.env.OWL_DB_NAME || "owlboard";
|
const dbName = process.env.OWL_DB_NAME || "owlboard";
|
||||||
const dbPort = process.env.OWL_DB_PORT || 27017;
|
const dbPort = process.env.OWL_DB_PORT || 27017;
|
||||||
const dbHost = process.env.OWL_DB_HOST || "localhost";
|
const dbHost = process.env.OWL_DB_HOST || "localhost";
|
||||||
const uri = `mongodb://${dbUser}:${dbPass}@${dbHost}:${dbPort}/?authSource=owlboard`;
|
const uri = `mongodb://${dbUser}:${dbPass}@${dbHost}:${dbPort}`;
|
||||||
|
const connOpts = {
|
||||||
|
useUnifiedTopology: true,
|
||||||
|
authSource: "owlboard",
|
||||||
|
}
|
||||||
|
|
||||||
const { MongoClient } = require("mongodb");
|
const { MongoClient } = require("mongodb");
|
||||||
|
|
||||||
const client = new MongoClient(uri);
|
const client = new MongoClient(uri, connOpts);
|
||||||
const db = client.db(dbName);
|
const db = client.db(dbName);
|
||||||
|
|
||||||
async function query(collection, query, returnId = false) {
|
async function query(collection, query, returnId = false) {
|
||||||
|
Loading…
Reference in New Issue
Block a user