fix mongodb templates and add migrate and generate scripts

This commit is contained in:
Aman Varshney
2025-05-02 22:17:51 +05:30
parent 437cf9a45a
commit 0cb24b1494
13 changed files with 765 additions and 443 deletions

View File

@@ -1,6 +1,9 @@
import mongoose from 'mongoose';
import mongoose from "mongoose";
await mongoose.connect(process.env.DATABASE_URL || "");
const client = mongoose.connection.getClient();
await mongoose.connect(process.env.DATABASE_URL || "").catch((error) => {
console.log("Error connecting to database:", error);
});
export { client };
const client = mongoose.connection.getClient().db("myDB");
export { client };