The UK Food Standards Agency evaluates various establishments across the United Kingdom, and gives them a food hygiene rating. You've been contracted by the editors of a food magazine, Eat Safe, Love, to evaluate some of the ratings data in order to help their journalists and food critics decide where to focus future articles.
- Connect to MongoDB and lunch mongosh
"C:\Program Files\MongoDB\Server\6.0\bin\mongod.exe" --dbpath="c:\data\db"
mongosh.exe
- Create the database uk_food with
use uk_food
- Create the collection establishments with
db.createCollection("establishments")
- Import the dataset with
mongoimport --type json -d uk_food -c establishments --drop --jsonArray establishments.json
from data directory
code.
code.
UK Food Standards Agency (2022). UK food hygiene rating data API. Contains public sector information licensed under the Open Government Licence v3.0.
Accessed Sept 9, 2022 and Sept 12, 2022 with the establishment settings as follows:
- longitude = 51.5072
- latitude = -0.1276
- maxdistancelimit = 4567
- pagesize = 10000
- sortoptionkey = distance
- pagenumber = (1,2,3,4,5,6,7,8)