Learn about getting all documents, getting a single document, and using query parameters for filters.
- [Instructor] In the start directory…of the exercise files for this module,…the index.js file is set up…with the Mongo connectivity we built,…along with a Hapi server definition.…If you'd like to dive deeper into Hapi,…you can check out my course on building APIs…using node.js and Hapi in the library.…For now, I'll give you a quick tour.…First, we'll tell Hapi to create a server…which listens on port 8080.…The routes come next.…They're kind of tricky…but notice that they're very clearly defined.…
There's an http method,…there's a path, and then there's a handler…to define what happens when that route is triggered.…I've placed stubs here for each…of the functions we'll be implementing,…to avoid a lot of copying and pasting.…At the bottom, the MongoClient.connect command…defines the collection and then it starts the Hapi server.…First we'll tackle the read functionality.…The get for the API tour list is our first task.…How do you think we'd retrieve a list…of all the tours in the system?…This is very similar to what we were doing earlier…
Author
Released
5/2/2017- Installing MongoDB for Windows and OS X
- Why Mongo?
- Document-oriented data
- Exploring the Mongo shell
- Importing data into the database
- Building an application in Node.js
- Tuning Mongo queries
- Aggregation
- Replication and sharding
Skill Level Intermediate
Duration
Views
Related Courses
-
Introduction
-
Welcome39s
-
Exercise files57s
-
Install MongoDB for Windows2m 41s
-
Install MongoDB for OS X2m 37s
-
Environment setup2m 38s
-
-
1. Understand MongoDB
-
Why Mongo?3m 37s
-
Document-oriented data3m 42s
-
Embed or reference?3m 31s
-
Performance4m 8s
-
-
2. Explore the System
-
Explore the Mongo shell6m 27s
-
Mongo shell operations5m 31s
-
Simple indexing5m 45s
-
-
3. Build an Application in Node
-
Node MongoDB setup4m 59s
-
-
4. Advanced Topics
-
Unique indexes4m 34s
-
Text indexes4m 49s
-
Model your schema6m 46s
-
Aggregation3m 8s
-
Replication and sharding4m 6s
-
-
Conclusion
-
Next steps49s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Add APIs for read requests in Hapi