Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Once you have a Map Function returning the data you want from CouchDB, you can save it as a view. Let's create a view on this dataset so we can use it again later. Navigate to the restaurant database. If it's not already selected, select Temporary View from the dropdown. It saved the Map Function from our previous Temporary View. If you don't already have this code in place, copy it in and click Run. We want to save this view, so we have all the content except for the page with the hours.
Click the Save As button, and then type in the name of the design document and the view name. The design document is something we can use to build an application with later. I'm going to name this design document pages and I'm going to name this view without_hours. So now you'll notice that the View dropdown has pages, our design document, and without_hours, the name of the view. We can go to all documents or we can switch to our view.
We can also get to a JSON- formatted version of this data. Remove everything from utils to the question mark, and then hit Enter. So now we have the ID for each document as well as the key and the value. We can also filter this view. At the end of the URL, add a question mark, type in key, type equals, and then within quotes, type Delivery.
Now the view is only showing the document that matches the key delivery. Views provide a permanent place where Map Functions can be stored and run. With a View function in place, not only do you gain an endpoint for using the data in your application, you're also able to further filter it by supplying a key.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 99890 Viewers
56 Video lessons · 113005 Viewers
71 Video lessons · 81836 Viewers
131 Video lessons · 39273 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.