Skip to content

Instantly share code, notes, and snippets.

@neerajkumar161
Created December 27, 2021 16:00
Show Gist options
  • Save neerajkumar161/30de7238e96f497a9cedd0793d040043 to your computer and use it in GitHub Desktop.
Save neerajkumar161/30de7238e96f497a9cedd0793d040043 to your computer and use it in GitHub Desktop.
src/models/user.ts
import {model, Schema} from 'mongoose'
const user = new Schema(
{
firstname: {type: String},
lastname: {type: String},
age: {type: Number},
email: {type: String},
password: {type: String}
},
{timestamps: true}
)
export const userModel = model('user', user)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment