akf-forum/util/reset.js
2022-09-17 15:19:41 +03:00

8 lines
277 B
JavaScript

const mongoose = require("mongoose");
require("dotenv").config();
mongoose.connect(process.env.MONGO_DB_URL, () => console.log("Database is connected"));
const Models = require("../models");
Object.values(Models).forEach(model => model.collection.drop().then(console.log));