MCPcopy Create free account
hub / github.com/Bitbox-Connect/Bitbox / connectToMongo

Function connectToMongo

server/db.js:6–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4// MongoDB URI
5let MONGO_URI = process.env.MONGO_URI || "mongodb://127.0.0.1:27017/Bitbox";
6const connectToMongo = async () => {
7 try {
8 mongoose.set('strictQuery', false); // Set to false for backwards compatibility
9 await mongoose.connect(MONGO_URI);
10 console.log('Connected to MongoDB Successfully');
11 } catch (error) {
12 console.error('Error connecting to MongoDB:', error);
13 }
14};
15
16module.exports = connectToMongo;

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected