Write Data to MongoDB
1
2
Post a request to create a restaurant entry
Send a Restaurant
instance to the add_restaurant
endpoint
by running the following command from the application root
directory:
curl -d \ 'restaurant[name]=Good+Earth+Cafe&restaurant[cuisine]=Cafe&restaurant[borough]=Queens' \ http://localhost:4567/add_restaurant
3
View the data
Refresh http://localhost:4567/list_restaurants in your web browser to view the new restaurant entry that you submitted. The inserted restaurant appears at the bottom of the list.
Note
If you run into issues, ask for help in the MongoDB Community Forums or submit feedback by using the Feedback button in the upper right corner of the page.