-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmenu_db.py
More file actions
178 lines (170 loc) · 4.95 KB
/
menu_db.py
File metadata and controls
178 lines (170 loc) · 4.95 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
from pymongo import MongoClient
# Replace with your MongoDB connection string
MONGO_URI = "mongodb://localhost:27017" # Change if using MongoDB Atlas
DATABASE_NAME = "feasto" # Change to your database name
COLLECTION_NAME = "menu"
# Connect to MongoDB
client = MongoClient(MONGO_URI)
db = client[DATABASE_NAME]
menu_collection = db[COLLECTION_NAME]
# Menu data to insert
menu_items = [
{
"order_id": 1,
"restaurant_name": "McDonald's",
"dish_name": "McAloo Tikki",
"price": 2,
"description": "Crispy Potato patty with lettuce, mayo & lots of cheese"
},
{
"order_id": 2,
"restaurant_name": "McDonald's",
"dish_name": "McSpicy Paneer",
"price": 5,
"description": "Flavourful Paneer layered with lettuce & spicy sauce"
},
{
"order_id": 3,
"restaurant_name": "McDonald's",
"dish_name": "McChicken",
"price": 4,
"description": "Crispy Chicken patty loaded with mayo & lettuce"
},
{
"order_id": 4,
"restaurant_name": "McDonald's",
"dish_name": "Big Mac",
"price": 6,
"description": "Two chicken patties along with our special sauce, lettuce & cheese"
},
{
"order_id": 5,
"restaurant_name": "McDonald's",
"dish_name": "McVeggie",
"price": 3,
"description": "Delicious Vegetable patty layered with lettuce & mayo"
},
{
"order_id": 6,
"restaurant_name": "McDonald's",
"dish_name": "Filet-O-Fish",
"price": 4,
"description": "Fish fillets with tartar sauce & cheese"
},
{
"order_id": 7,
"restaurant_name": "McDonald's",
"dish_name": "McFlurry Oreo",
"price": 3,
"description": "Classic Vanilla ice cream with Oreo crumbles"
},
{
"order_id": 8,
"restaurant_name": "McDonald's",
"dish_name": "French Fries",
"price": 2,
"description": "Crispy golden fries"
},
{
"order_id": 9,
"restaurant_name": "McDonald's",
"dish_name": "McCafé Latte",
"price": 3,
"description": "Smooth espresso with steamed milk"
},
{
"order_id": 10,
"restaurant_name": "McDonald's",
"dish_name": "Chocolate Shake",
"price": 4,
"description": "Rich chocolate milkshake"
},
{
"order_id": 11,
"restaurant_name": "Domino's",
"dish_name": "Classic Margarita",
"price": 19,
"description": "None required for this one right ?"
},
{
"order_id": 12,
"restaurant_name": "Domino's",
"dish_name": "Paneer Pizza",
"price": 5,
"description": "Spicy paneer, bell peppers and mushroom topped along with loads of cheese"
},
{
"order_id": 13,
"restaurant_name": "Domino's",
"dish_name": "Veggie Supreme",
"price": 7,
"description": "Capsicum, onion, olives & cheese"
},
{
"order_id": 14,
"restaurant_name": "Domino's",
"dish_name": "Pepperoni Pizza",
"price": 10,
"description": "Pepperoni, mozzarella & tomato sauce"
},
{
"order_id": 15,
"restaurant_name": "Domino's",
"dish_name": "Garlic Bread",
"price": 4,
"description": "Garlic butter, herbs, cheese"
},
{
"order_id": 21,
"restaurant_name": "Burger King",
"dish_name": "Whopper",
"price": 8,
"description": "Vegetable patty, cheese, lettuce & tomato"
},
{
"order_id": 22,
"restaurant_name": "Burger King",
"dish_name": "Crispy Veg Burger",
"price": 3,
"description": "Crispy veg patty, lettuce & mayo"
},
{
"order_id": 23,
"restaurant_name": "Burger King",
"dish_name": "Veggie Strips",
"price": 4,
"description": "Cheesy & crispy vegetable strips"
},
{
"order_id": 31,
"restaurant_name": "Starbucks",
"dish_name": "Caramel Macchiato",
"price": 4.99,
"description": "Espresso with steamed milk, vanilla syrup, and caramel drizzle"
},
{
"order_id": 32,
"restaurant_name": "Starbucks",
"dish_name": "Caffè Latte",
"price": 3.99,
"description": "Smooth espresso blended with steamed milk"
},
{
"order_id": 33,
"restaurant_name": "Starbucks",
"dish_name": "Mocha Frappuccino",
"price": 5.49,
"description": "Coffee, milk, and ice blended with rich mocha sauce"
},
{
"order_id": 34,
"restaurant_name": "Starbucks",
"dish_name": "Pumpkin Spice Latte",
"price": 5.99,
"description": "Espresso and steamed milk with pumpkin spice flavors"
}
]
# Insert data into MongoDB
result = menu_collection.insert_many(menu_items)
# Print inserted IDs
print(f"Inserted {len(result.inserted_ids)} menu items into MongoDB.")