mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-17 01:15:05 +03:00
Akif9748
ae83e014a0
The dublicate key error fixed, ids as string. classes removed. using mongoose's magic
16 lines
442 B
JavaScript
16 lines
442 B
JavaScript
const mongoose = require("mongoose");
|
|
require("dotenv").config();
|
|
|
|
mongoose.connect(process.env.MONGO_DB_URL, () => 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")
|
|
})();
|
|
|
|
|