import * as mongoose from "mongoose" ; const schema = new mongoose . Schema ( { name : { type : String , required : true } , password : { type : String , hidden : true } , email : { type : String , required : false , index : true } } , { timestamps : { createdAt : "createdAt" , updatedAt : "updatedAt" } , collection : "user" } ) ; const UserModel = mongoose . model ( "User" , schema ) ; export default UserModel ;