-
Notifications
You must be signed in to change notification settings - Fork 0
/
mockDB.py
40 lines (38 loc) · 1.03 KB
/
mockDB.py
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
from pymongo import MongoClient
client = MongoClient()
client.mockDB.reviews.drop()
coll = client.mockDB.reviews
data = [
{
'name': 'Fang',
'url': 'http://www.yelp.com/biz/fang-san-francisco-2',
'reviews': [
{
'body': 'What an amazing foodie experience at Fang!',
'rating': 5.0
},
{
'body': 'The serious was relatively slow and the main guy was very pushy about his suggestions.',
'rating': 3.0
}
],
'menu_items' : [
'Fried Potstickers', 'Fried Onioncake', 'Steamed Pork Dumplings'
]
},
{
'name': 'Los Hermanos Taqueria',
'url':'http://www.yelp.com/biz/los-hermanos-taqueria-san-francisco',
'reviews': [
{
'body': 'DELICIOUS! It is a little sketchy, just because it\'s literally INSIDE a liquor store, but the lady who took our order was very sweet and giving.',
'rating': 5.0
}
],
'menu_items': [
'Super Burrito', 'Chicken Caeser Salad', 'Mexican Salads'
]
}
]
for datum in data:
coll.insert(datum)