mirror of
https://github.com/rjNemo/MERN_sample_app
synced 2026-06-06 16:56:40 +00:00
27 lines
420 B
JavaScript
27 lines
420 B
JavaScript
import mongoose from "mongoose";
|
|
|
|
const UserSchema = new mongoose.Schema({
|
|
username: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
email: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
roles: {
|
|
type: Map,
|
|
of: Boolean,
|
|
},
|
|
photoUrl: {
|
|
type: String,
|
|
default: "",
|
|
},
|
|
phoneNumber: {
|
|
type: String,
|
|
default: "",
|
|
},
|
|
});
|
|
|
|
const User = mongoose.model("user", UserSchema);
|
|
export default User;
|