-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathidea.js
45 lines (39 loc) · 755 Bytes
/
idea.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { Mongoose } from "mongoose"
const product = {
name: "Tiro tracks",
desc: "lorem ipsum idit icit aklfjsdfasdafda",
colors: [
{
color: String,
images: [
{
type: String,
required: true
}
]
}
],
category: [String],
sold: {
default: 0,
type: Number,
},
quantity: Number,
discount_in_percent: Number,
// reviews: [
// {
// rating:
// }
// ]
}
const Cart = {
prouctId: {
type: Mongoose.Schema.Types.ObjectId,
ref: 'Product'
},
quantity: {
type: Number,
required: true,
min: 1
}
}