GitHub - mongodb/docs-assets at drivers (original) (raw)
MongoDB Driver Documentation Assets
The restaurants.json dataset contains 10 documents of the form:
{ "_id" : , "name" : , "contact" : { "phone" : "email" : "location" : [ , ] }, "stars" : int, "categories" : "grades" : , }
Import DataSet
Note: The MongoDB deployment to which you wish to import the data must be running.
- Download and save the restaurants.json dataset.
- In the terminal shell or command prompt, use
mongoimport
(ormongoimport.exe
on Windows) to insert the documents. For example, the followingmongoimport
connects to amongod
instance running on localhost on port number27017
.
mongoimport --db test --collection restaurants --drop --file
Note: Ifmongoimport
is not in your path, either update the path or specify the full path to the executable.
To import to a MongoDB deployment running on a different host or port, specify--host
and--port
options in your mongoimport command. See mongoimportfor details on available options.