-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01_setup.mongodb.js
More file actions
65 lines (59 loc) · 1.42 KB
/
Copy path01_setup.mongodb.js
File metadata and controls
65 lines (59 loc) · 1.42 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use('ecommerce');
db.dropDatabase();
db.products.insertMany([
{
name: "Wireless Mouse",
price: 799,
category: "Electronics",
stock: 120,
ratings: 4.5,
tags: ["computer", "accessory", "wireless"],
createdAt: new Date()
},
{
name: "Mechanical Keyboard",
price: 2499,
category: "Electronics",
stock: 80,
ratings: 4.8,
tags: ["keyboard", "mechanical"],
createdAt: new Date()
},
{
name: "Gaming Laptop",
price: 85999,
category: "Computers",
stock: 30,
ratings: 4.6,
tags: ["gaming", "laptop"],
createdAt: new Date()
}
])
db.contacts.insertMany([
{ name: "Alice", message: "Loved your website!", phone: "9876543210", createdAt: new Date() },
{ name: "Bob", message: "Do you have discounts on laptops?", phone: "9123456789", createdAt: new Date() },
{ name: "Carol", message: "I want to cancel my order.", phone: "9988776655", createdAt: new Date() }
])
db.orders.insertMany([
{
orderId: "ORD001",
user: "John Doe",
products: [
{ name: "Wireless Mouse", quantity: 1, price: 799 },
{ name: "Mechanical Keyboard", quantity: 1, price: 2499 }
],
total: 3298,
status: "Delivered",
createdAt: new Date()
},
{
orderId: "ORD002",
user: "Jane Smith",
products: [
{ name: "Gaming Laptop", quantity: 1, price: 85999 }
],
total: 85999,
status: "Pending",
createdAt: new Date()
}
])