Learn about libraries, connecting to the database using the MongoDB driver, and a basic find from Node.js.
- [Instructor] Now we're going to write some code…in node.js to interact with the database.…We'll use the MongoDB driver for node.…The drivers for all of the languages work similarly…so once you've worked with it in node,…you should have no problem translating your experience…into another language.…Make sure that your Mongo server is running…in a terminal or command prompt…before opening your text editor…to work with the node script.…Open the index.js file which is empty…or create one of your own.…The first thing we need to do is set up the Mongo client…using the MongoDB package.…
So var MongoClient…equals require mongodb.MongoClient.…Great.…The url for the database uses the MongoDB protocol…and connects to the specified server.…So var url equals…mongodb and then we're using local host.…And we're using the default port,…27017 for the MongoDB instance.…
The final piece is the database you want to connect to…and remember we're using learning_mongo here,…leanring_mongo.…Now we have the url set up…and what we need to do is connect to the database.…
- 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
- Replication and sharding
Skill Level Intermediate
1. Understand MongoDB
2. Explore the System
3. Build an Application in Node
Node MongoDB setup4m 59s
4. Advanced Topics
- 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.Cancel
Take 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.