У меня есть следующая схема для пользователя:
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
// Create Schema
const UserSchema = new Schema({
username: {
type: String,
unique: true,
default: ""
},
email: {
type: String,
required: true
},
date: {
type: Date,
default: Date.now()
}
});
module.exports = User = mongoose.model("users", UserSchema);
По какой-то досадной причине я получаю ошибку [eslint] User is not defined
. Что здесь не так?
Я использую веб-пакет стека MERN.