Latest Project, Trash and setting API and sockets along with the Model clearance
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import { Document, Schema } from "mongoose";
|
||||
import MainModel from "../connect/mongoose.ts";
|
||||
export interface User extends Document {
|
||||
userName: String;
|
||||
@@ -48,24 +48,8 @@ const signupschema: Schema = new Schema({
|
||||
default: [],
|
||||
},
|
||||
});
|
||||
// const userModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || "";
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error("MONGO_URI environment variable is not set");
|
||||
// }
|
||||
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
|
||||
// // Return the model
|
||||
// return dbConnection.model("Users", signupschema, "Users");
|
||||
// };
|
||||
|
||||
// export default userModel;
|
||||
const userModel = (db: string) => {
|
||||
return MainModel(db, "Users", signupschema, "Users");
|
||||
const userModel = (db:string) => {
|
||||
return MainModel(db, "Users", signupschema, "Users")
|
||||
};
|
||||
export default userModel;
|
||||
|
||||
Reference in New Issue
Block a user