This commit is contained in:
Primakov Alexandr Alexandrovich
2025-05-08 15:48:02 +03:00
parent 48167530fd
commit 95bcaf3c5e
3 changed files with 13 additions and 9 deletions

View File

@@ -1,15 +1,18 @@
const MDBClient = require('mongodb').MongoClient
import { MongoClient as MDBClient } from 'mongodb'
const { mongoUrl } = require('./const')
import { mongoUrl } from './const'
const dbInstanses = {
}
console.log('=======================================================')
console.log('mongoUrl', mongoUrl)
console.log('=======================================================')
const mongoDBConnect = async () => {
try {
const MongoClient = new MDBClient(mongoUrl, {
useUnifiedTopology: true,
})
const MongoClient = new MDBClient(mongoUrl, {})
const client = await MongoClient.connect()
console.log('Подключение к MongoDB успешно')
return client