MongoDB Working with APIs and Practical Examples
Full Tutorial:
http://go.ipenywis.com/ipeny6a8b
--- Official Links----
Official Website: http://ipenywis.com
Official Facebook: http://go.ipenywis.com/ipeny4907
Official Twitter: http://go.ipenywis.com/islem9a03
Official GitHub Repo: http://go.ipenywis.com/ipeny5c0e
---Support US---
By Becoming a Patreon: http://go.ipenywis.com/ipeny5024
What You'll Learn
This video tutorial covers working with MongoDB and APIs, specifically converting a Pokémon API to use a MongoDB database. It demonstrates how to require MongoDB, create a model, compile the model, and connect to the database.
Full Transcript
have fun on guys how all your doing welcome to new video tutorial on the MongoDB Cruz series so in the last one not cover the basics things about like installing the MongoDB binaries on your machine and setting up everything in just a quick test of how MongoDB works and like the differences between in a rational and a non rational database is like my CEO on a MongoDB the main difference is the major differences between them and I'm actually MongoDB works and why it is very very suitable for Web projects so but for this particular tutorial we're going to do is like convert this pokémons API over here into like from hard-coded the array data like storing the information or the data on like a server-side ray variable into like using it to a real world example for like making this gonna be stored on a real database which is like the MongoDB so if you're not I like knowing what is this pokemon pokemon API thing so in the API store like chemistry on the channel actually so if you have to watch this and we do recommend go ahead watch it because we have explaining all of that like how to make this web server and we've gone through this like step by step explain what is this doing and why it's really important thing in here and everything just going on about this pokemons API so it's pretty much what it does is just go ahead and like we can request some data from this server like client there's a client and there's a server so the client requested data from the server and the server responds with the requested or the needed data from the actual user or from the actual client like getting the pokemons list over you which means this one the names of a bacon oakmoss or adding a specific Pokemon or removing another specific Pokemon so what we're going to do is to make this or so make this one application or this API server supports MongoDB to store the actual data into MongoDB so first things first to get started with actually or we need to like require the MongoDB and actually before that you need to start the service so make sure you have watched and install MongoDB on your machine so just on than the last Oreo run it and make sure that the service is running and also make sure Jonestown mangoes and you're like no DTS project so npm install' mangoes and everything gonna be working fine now we need to start like the mango thing we need to go like mangoes and equals required mangoes so we need to require everything requirement goes over here so mangoes yeah and the other thing we need to like this required up so now I'm typing required now actually we need to like make it the model the actual model like like the model who created the last time the for the user and the password and all this kind of things we need to do it the same for the pokemons in here so in order to make it work and we don't look like to and to be able to like interactive the database save the DNA and fix the DN a-- from there so first things first let's obviously require the mangoes over here so just make sure to like constant mangas require and not you require mangoes over on the top of there and here we create the model and the model gonna be very very simple so let's let's pull him over for example equals or the scanner so we create this camera and like then compile compile it into a model so we do like you scanner and make sure to require the scanner which i haven't already done that so make sure to go up over there and just scan up upper case equals mongos or mongos don't come okay so everything is working fine over here so now I need to go ahead and do this our schema so this gamma gonna be very simple as I've said it takes the first thing in your s the name of the Pokemon so we type in name and like the type of that's going to be a string and is going to be a required thing and the other thing is ability so ability also is going to type of office training and the required gonna be very gonna be true so make sure it's your feel free to use any other attributes for that but this will do the job for us and yeah you can have that other fields in here feel free to run whatever you need over here going to make yours looks better and now we need to compile it into a model so let's let's just call the scanner and let's pokemon equals nominee choose the man goes to top model in order to compile it into real models so we passing the model name we're gonna call it just a pokemon and the fascination list name so you can access this later on from any other like for any piece of code in your project or from either side of your project whenever you compile it then you want to access just call this function without passing in the schema and it's gonna return for you the actual compiled model from schema so this is a really nice feature from manga over here and yeah we need to pass in the modern schema and everything gonna be compiled no need to call or over you I mean on the end this kind of route over here like this route specifically is getting all of the like all of the data on the database so all the dance is just gonna return Vienna the database fetch the data all of the pokemons from the database then return them or send them back into the e user so the user can fit can just display them on when he is like script or like the client pretty much so all this done is just gonna grab grab it from the database and send it out so Jason as you can see in here so status then we send Ian has a pokemons array over here and a Pokemon so gonna be very simple so all we need to do over here let me just testing we need to use our model so the models gonna be used pretty much everywhere so whatever you need to say whenever you need like to fake from the database whenever you need to remove or update any data from the database from on God you need to require the PO or the models the model that you have or you want to access the data into so make sure to click to have that and the model can be compiled of course from this camera so make sure to have that and like find find all pokemons maybe much 1/2 like you forgot about doing pretty much envy like the male most important thing is just connecting database so we haven't like open up a stream or we haven't connects and database actually so let's do that up here so connects to the database and make sure to the connect to the database using just the mongos don't connect and here we put in the stream which we're gonna be like MongoDB and like MongoDB for our protocol and put in localhost we put in like forward slash than our database name which gonna call it just okey okey mom okay pretty simple and here like we're putting the other thing the array or the callback at this toy I'm confusing console without checking for the call so the log connected and yeah here we got not only connected we create the model and everything should be looking fine I really just keep taking me at the end of the file but yeah this is fine now when you're here to like as I've said to look for the database so for that we put in Pokemon doc find and this fine method gonna just give it the first thing so there's like a four of them the first condition is an object and the second one is just gonna a callback runs whenever the gala is being or when whenever the Vienna has been fetch it from the database so the first one is the object of like whatever you want to search for so the earth is the objects we're gonna use here is an empty object since we want to get all of the data from the database which means all of the pokémon listed them there we want to grab them from the other base and just gonna be returned for us and here the second one is going to be as you can see the array all the callback which has the first one is
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from CoderOne · CoderOne · 30 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
▶
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Laravel CMS | N-01 | Getting Started and Environment Set Up
CoderOne
Laravel CMS | N-02 | Routes, Controllers and Views
CoderOne
Laravel CMS | N-03 | Dealing With Assets and Page Layouts
CoderOne
Laravel CMS | N-04 | Migration, Models and Adding Categories
CoderOne
Laravel CMS | N-05 | Showing Added Categories, and Session Messages
CoderOne
Laravel CMS | N-06 | Edit\Remove Categories using AJAX and Popups
CoderOne
Laravel CMS | N-07 | Add New Post
CoderOne
Laravel CMS | N-08 | Creating a Basic Laravel Blog
CoderOne
HTML5 Canvas For Beginners | Getting Started | #01 with Webpack
CoderOne
HTML5 Canvas For Beginners | Drawing Basic Shapes | 02
CoderOne
HTML5 Canvas | Drawing Text With Circles | Part 01
CoderOne
HTML5 Canvas | Text Animation and Circle Collision | Part 02
CoderOne
Complete Guide To Web Development In 2018
CoderOne
AJAX & JSON Explained | Examples
CoderOne
Visual Studio Code Web Development Setup and Extensions
CoderOne
Electron Build Desktop Apps HTML/CSS/JS - Getting Started 01
CoderOne
Electron Build Desktop Apps HTML/CSS/JS | Creating Windows and Processes 02
CoderOne
Electron Build Desktop Apps HTML\CSS\JS | Dialog, Sessions and Cookies 03
CoderOne
Electron Build Desktop Apps HTML\CSS\JS | Custom App Menu & Context Menu 04
CoderOne
Electron Build Desktop Apps HTML\CSS\JS | Package, Build and Deploy your App 05
CoderOne
Node.js Brief Beginners Introduction #01
CoderOne
Node.js How Modules Works & NPM #02
CoderOne
Node.js Working With Events and Event Emitter #03
CoderOne
Node.js File System (Read and Write) FS 04
CoderOne
Node.js Create a Basic Server Using Express 05
CoderOne
Json Web Token Authentication JWT Explained Securing API
CoderOne
CSS Flex Box Design | Practical Examples |
CoderOne
API How It Works With Practical Examples
CoderOne
MongoDB Getting Started 01
CoderOne
MongoDB Working with APIs and Practical Examples
CoderOne
Create a Command Line Interface (CLI) Using Node JS #01
CoderOne
Create a Command Line Interface (CLI) Using Node JS 02
CoderOne
Build React Apps | Introduction And Getting Started #01
CoderOne
Build React Apps | Working With Components And Multiple Rendering #02
CoderOne
Build React Apps | App State Management | Practical Examples #03
CoderOne
Build React Apps | Getting Started With Flux (Intro) #04
CoderOne
Build React Apps | Create a Clock Timer Using React 05
CoderOne
Build React Apps | Create a Clock Timer Using React 05 | PART2|
CoderOne
CSS Preprocessors Getting Started | SASS and LESS | Practical Examples
CoderOne
Regex Introduction | Learn Regular Expressions 01
CoderOne
PHP VS Node.js Which is Best For Web Development
CoderOne
Drag and Drop Using Native Javascript 01
CoderOne
Drag And Drop Using Native Javascript 02
CoderOne
Master Git (Version Control) in One Video From Scratch
CoderOne
Let's Learn The New Javascript ES6 Class Syntax
CoderOne
Let's Create A BlockChain On Node.js
CoderOne
Best Online Code Editors For Web Developers
CoderOne
Let's Create a Modern Login Form on React #01
CoderOne
Let's Create a Modern Login Form on React #02
CoderOne
Laravel CMS | N-09 | Admin Registration
CoderOne
Laravel CMS | N-10 | Login and Authentication
CoderOne
Let's Create a Twitter Bot (Listen and Retweet)
CoderOne
Rapid Webpage Creation With Emmet (HTML & CSS)
CoderOne
Create Popups and Modals Using Native Javascript, HTML and CSS
CoderOne
Promises and Callbacks on Javascript With Practical Examples
CoderOne
Create Collapses using Native Javascript, HTML and CSS
CoderOne
Let's Learn Typescript (Javascript Devs) | Getting Started 01
CoderOne
Let's Learn Typescript | Interfaces and Generic Types (The Typing System) 02
CoderOne
Let's Learn Typescript | Work With Classes, Modules and Enums 03
CoderOne
Let's Learn Typescript | React and Webpack With TS 04
CoderOne
Related AI Lessons
⚡
⚡
⚡
⚡
7 Best AI Tools for Research, Coding, and Development in 2026
Medium · Data Science
7 Best AI Tools for Research, Coding, and Development in 2026
Medium · Programming
How to Write a Project Status Report With AI in 15 Minutes
Medium · AI
7 AI Tools That Can Save You Hours Every Week
Medium · AI
🎓
Tutor Explanation
DeepCamp AI