forked from GreatStackDev/QuickCart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.js
More file actions
14 lines (10 loc) · 432 Bytes
/
Copy pathUser.js
File metadata and controls
14 lines (10 loc) · 432 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import mongoose from "mongoose";
const userSchema = new mongoose.Schema({
_id: { type: String, required: true },
name: { type: String, required: true },
email: { type: String, required: true, unique: true },
imageUrl: { type: String, required: true },
cartItems: { type: Object, default: {} },
}, { minimize: false })
const User = mongoose.model.user || mongoose.model('user', userSchema)
export default User