akf-forum/util/admin.js
Akif9748 ae83e014a0 Mongoose is fixed & optimized
The dublicate key error fixed, ids as string.
classes removed. using mongoose's magic
2022-08-09 19:16:34 +03:00

15 lines
327 B
JavaScript

const mongoose = require("mongoose");
require("dotenv").config();
mongoose.connect(process.env.MONGO_DB_URL, () => console.log("Database is connected"));
const { UserModel } = require("../models");
(async () => {
const member= await UserModel.get(0);
console.log(member);
member.admin = true;
member.save();
})();