akf-forum/reset.js

15 lines
425 B
JavaScript
Raw Normal View History

2022-04-06 21:14:46 +03:00
const mongoose = require("mongoose");
mongoose.connect('mongodb://localhost:27017/akf-forum', () => console.log("Database is connected"));
const { SecretModel, UserModel, MessageModel, ThreadModel } = require("./models");
(async () => {
await UserModel.deleteMany({});
await ThreadModel.deleteMany({});
await MessageModel.deleteMany({});
await SecretModel.deleteMany({});
console.log("Success")
})();
2022-03-13 16:16:46 +03:00