{"size": 1071, "ext": "js", "max_stars_repo_path": "backend/models/activity.model.js", "max_stars_repo_name": "N-liraj-khanna/Management-Tool-MERN-App", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "backend/models/activity.model.js", "max_issues_repo_name": "N-liraj-khanna/Management-Tool-MERN-App", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "backend/models/activity.model.js", "max_forks_repo_name": "N-liraj-khanna/Management-Tool-MERN-App", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.2826086957, "max_line_length": 93, "alphanum_fraction": 0.6050420168}
//  To add custom data
// const data = require("../data");
// require("colors")
// require("dotenv").config({path: "./backend/config/config.env"});
// const mongoose = require("mongoose");

// const connectDB = async ()=>{
//   try{
//     const conn = await mongoose.connect(process.env.MONGO_URI);
//     console.log(`Mongo DB Connected Successfully: ${conn.connection.host} `.bgCyan.black);
//   }catch(err){
//     console.log(`${err}`.red);
//     process.exit(1);
//   }
// }

// connectDB()

const mongoose = require("mongoose");

const UserSchema = mongoose.Schema(
  {
    activity: {
      type: String,
      required: "Title is required",
    },
    description: {
      type: String,
    },
    user: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
  },
  { collection: "activity" }
);

const Activity = mongoose.model("Activity", UserSchema);

module.exports = Activity;

// data.forEach(async function (d) {
//   const act = await new Activity({
//     activity: d.activity,
//     description: d.description,
//   });
//   await act.save();
// });
