mongoose 不加s的办法

//创建我们的用户Schema
const userSchema = new Schema({
    UserId: ObjectId,
    userName: { unique: true, type: String },
    password: String,
    createAt: { type: Date, default: Date.now() },
    lastLoginAt: { type: Date, default: Date.now() }
},{
    //配置后生成的表格中就不加s
    collection:'user'
})

 

posted @ 2021-01-26 09:56  freeming211  阅读(132)  评论(0)    收藏  举报