Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
The example Map Function that it gives us is one that simply calls emit. Emit takes two arguments; first the key and then the value. If we click the default function, it gives us the results; and each key is null, and every value is the complete document. Let's specify a key. Select null and then replace it with doc.name. When we click Run again, it shows the name of every document as the key and then uses the entire document as the value.
Let's specify the value. Go to the second argument and add .content. Then click Run again. Now you'll notice this view has the name as the key and the content as the value. Now let's say we wanted this view to include every document in the database except the one with the Hours property. We can wrap this emit function in an if statement. So I'm typing in if(!doc.hours) and then wrapping the emit statement in this block.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 102019 Viewers
61 Video lessons · 88736 Viewers
71 Video lessons · 72559 Viewers
56 Video lessons · 104200 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.
Your file was successfully uploaded.