R
На гитхабе видел несколько схем такого типа
const mongoose = require('mongoose')
var Schema = mongoose.Schema;
const userSchema = new Schema({
chat_id: {
type: Number,
index: true,
unique: true,
required: true
},
first_name: {
type: String,
required: true
},
last_name: String,
username: String,
}, {
timestamps: true
})
const User = mongoose.model("User", userSchema)
module.exports = User
Но я всё время получаю ошибку
The 2nd parameter to `mongoose.model()` should be a ' +
'schema or a POJOПодскажите, пожалуйста, что я делаю не так

