UNPKG

create-bz-mern-app

Version:

CLI to scaffold a fullstack React + Node.js app with Google login and JWT auth

26 lines (20 loc) 448 B
import { Schema, model } from "mongoose"; const userSchema = new Schema({ name: { type: String, required: true }, email: { type: String, required: true }, avatar: { type: String, default: 'https://avatar.iran.liara.run/public' }, role: { type: String, default: 'user' } }, { timestamps: true }) export const User = model('user', userSchema);