This worked for me
```import { Schema, model, models } from "mongoose";
const UserSchema = new Schema({ displayName: { type: String, required: true }, email: { type: String, required: true, unique: true }, phone: { type: String, unique: true }, password: { type: String }, pro: { type: Boolean, default: false }, author: { type: Boolean, default: false }, photoURL: { type: String }, }); console.log(model); // undefined console.log(models.UserModel); //this solved const User = models.UserModel;
export default User;
```