This video introduces you to some basic insert operations for MongoDB
- [Instructor] So far we haven't done a lot here…because we are just connecting to Mongodb.…Now we also want to write data into the database.…First of all, let me real quick copy this function here.…See this fetch for me, that function,…on top of this MongoClient.…So next we will simply use this fetchFromAPI…call from down here starting with line 26,…and put it up here…into our connect callback…because we want to call the API…as soon as we have database connection.…
And let's move this database close call also…here into this…fetchFromAPI call to close it, the database,…not too early because now here…we also want to insert this data into MongoDB,…and for that we will create the new function…that I will call insert into MongoDB.…Okay, so right after this…fetchFromAPI I add a function,…insertMongodb, and into this function…we'll pass database collection and some data.…
Next we will do some promise magic in here.…If you haven't heard about Node.js promises…at all, I would recommend read up…a little bit on them.…It will help you to follow along this course.…
- Basics of relational and nonrelational databases
- Preparing your environment
- When to use document databases
- Inserting data into MongoDB
- Basic insert operations for MongoDB
- Querying data from MongoDB with Node.js
- Using key-value stores
- Using relational databases with Node.js
- Adding MySQL and Sequelize to a project
Skill Level Intermediate
Node.js: Build Your First Microservice (2016)with Daniel Khan2h 9m Intermediate
1. Get Started with Databases for Node.js
2. Prepare Your Environment
3. Use Document Databases with Node.js
4. Use Key-Value Stores with Node.js
5. Use Relational Databases with Node.js
- 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.