Junaidb commited on
Commit
4c669c4
·
verified ·
1 Parent(s): 2a70fa3

Create dbconnection.js

Browse files
Files changed (1) hide show
  1. dbconnection.js +19 -0
dbconnection.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { MongoClient, ServerApiVersion } from 'mongodb';
2
+ const uri = "mongodb+srv://junaid:junaid@cluster0.0ec6y.mongodb.net/?appName=Cluster0";
3
+
4
+
5
+ const client = new MongoClient(uri, {
6
+ serverApi: {
7
+ version: ServerApiVersion.v1,
8
+ strict: true,
9
+ deprecationErrors: true,
10
+ }
11
+ });
12
+
13
+
14
+
15
+ function provideClient() {
16
+ return client;
17
+ }
18
+
19
+ export {provideClient}