MongoDB Basics, CRUD and Node.js Integration

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey welcome back to this bootcamp series in this video we're going to learn about databases or to be more specific mongodb now so far in this series we've learned about programming we've learned about servers but none of it has felt very real world and this is because we haven't had any permanent place to store data or to load data from right so instead of storing data in a permanent place we've just been logging it to the console and instead of loading data from a permanent place we've just been faking hard-coded json so i think having a database to work with is going to change all of that for the better i think this is where the things that you're coding and building can start to feel realistic or meaningful one last thing before we jump into the action this entire bootcamp series is sponsored by me so as many of you know udemy every year runs a big sale towards the end of november and as far as i'm aware that sale hasn't actually started yet but i've been getting emails and comments uh people asking do you know when the sale is going to start or do you have any discounted coupon codes you can share and the answer is uh yes i do so in the description for this video there will be a link to each and every one of my udemy courses at the lowest possible price and those coupon links are good for the next four or five days okay so that's just something to check out anyways having said that let's jump into the action let's learn about mongodb okay so we're going to be using mongodb in this video but before we really get started i want to put that into context because there are many different database systems to choose from so in this bootcamp series so far we've been using node.js for our server side or backend code now node is just one of many many server side languages we could have chosen instead of node we could have used php or python or ruby or any other language to handle our back end code the reason i chose node for us in this bootcamp series is because we already need to learn javascript for client-side reasons right front-end javascript so i figured let's not use any more brain horsepower learning multiple languages because when you're just starting out it takes a lot of brain horsepower just to understand how all the different puzzle pieces of development fit together so i think it's a good idea to just use one language javascript for everything however down the road once you're a bit familiar with the jobs and responsibilities of each piece of technology then i think it's an excellent idea to learn a different server side language whatever you choose okay and now everything i just said about server side languages this also holds true for database systems so again in this video we're going to learn about mongodb just because we can continue to use the javascript syntax but in reality once you're a bit comfortable with how all the different puzzle pieces of an app fit together down the road i would recommend you learn another database system like mysql or postgres or you know there's a bunch of others to choose from and you can mix and match any of these backend server side languages with any of these database systems right every server side language has a driver that will allow it to work with basically any database system so those are really subjective personal opinionated choices for you to make i just want to be clear that the reason we're using node and mongodb is not because i think they're the quote best but simply because they require the least amount of brain horsepower when you're just starting out right we can just use this one syntax of javascript and we don't have to have all these contextual shifts between different languages when we're really just trying to get a big picture understanding of how web apps work anyways having said all of that we are going to use mongodb as our database system in this video and we're also going to continue to use node as our back end i just didn't want to come across as super dogmatic about our tech choices okay so how do we actually get started well you absolutely can install a database system locally on your personal computer for development and educational situations however once you push your website or app live up onto the web you'll also need a copy of your database to be hosted up on the web as well so in order to keep things as simple as possible in this video i'm going to recommend we just create a mongodb database up in the cloud that way it's online and hosted from the very start now if you're a bit more experienced you might want to look up a tutorial on youtube about installing mongodb on your computer so you can work locally absolutely that's a great idea but for everyone else for most people this cloud path is what i recommend when you're just starting out okay this way we don't need to install anything on our computer and when we're ready for our app to be live up on the web our database is just already on the web so to get started it is completely free just go to the official mongodb.com website and we just want to sign up for a free account so you can use the try free button or the start free just go ahead and sign up so go ahead and fill out the registration form and then on the next screen or screen or two after this it'll ask you to choose a path there will be several different ways for you to quote create a cluster so you just want to choose the option that is free we don't need to spend any money right now when we're just trying to learn how to use mongodb at the time of this recording the free option is on the right side of the screen so you're looking for the create a cluster button that is free after that on the next screen it'll ask you to choose a cloud provider you can choose between aws google cloud microsoft azure i would just stick with the default aws and actually i would just use the default options for every setting on that screen and then just at the bottom click create cluster okay after that you should be taken to a dashboard screen that looks something like this now when you're very first creating a cluster it is going to take somewhere between one to maybe five minutes and you'll probably even see a message right about here that says creating your cluster for the first time please wait so you can just go ahead and pause this video and then once that actually finishes now we can move forward together okay so for our first real task let's try to store a bit of data in the database well actually first to do that we need to create a database so to do that let's click on this collections button right here okay now the very first time you go to this screen when your account is brand new you're going to see this explore your data and then it's going to ask you do you want to load in a bit of example sample data or do you just want to add your own so let's click this add my own data okay and then it's going to say hey you don't have any databases you need to create a new database so you can choose any name you want i'll just choose maybe youtube lesson okay and then in mongodb when you create a database you have to create a first collection if you've ever worked with mysql or another database system you can think of a collection basically as a table right it's sort of the main top-level way to divide our data up into organized areas so for example on twitter there would be one collection called users with all the usernames and passwords and then there would be another collection called tweets with all the tweets why don't we create a first collection just call it pets okay let's go ahead and click create okay cool so we have our one database and it has one collection if you wanted to create additional databases you can do that so imagine we were creating a pet adoption website you'd have one collection for pets one collection for users so on and so forth so a collection is just a way to organize or group your data at this point let's try to actually store a new item or a document or a piece of data in our pets collection so if you click on pets then on this right hand side obviously we have zero results so far but we do see this insert document button so let's try that okay so this is how you would create a new document or item in the collection now in mongodb we really just give it a json object right so we don't need to learn a new language or new syntax this is just javascript so let's imagine that each pet document or each pet item should have a name a species and an me zoom in a little bit so let's give it a property of name and then you can just hit tab and let's set its name to meows a lot let's hit tab again let's give it a property of species tab let's say cat let's say age is three okay now you'll notice that by default it already gave us this property of underscore id so the idea here is that mongodb will automatically give each item a unique id okay let's go ahead and click insert cool so now our pets collection now has one document or one item in it it's the meows a lot cat now i won't bore you by adding additional documents right now but you saw that you just insert a document and you give it a bit of javascript or json so off camera right now let me add a few more example sample pets okay so now i have half a dozen pets and some are dogs some are cats you get the idea now sort of the whole point of a database is that you can look up just the data you're interested in so imagine instead of six pets there were six million or six thousand and what if we only want to see the cats that are under the age of three or the dogs that are over the age of four well actually really quick before i show you how to find or look for certain data in the database i do want to talk about the types of data we're storing so if i hover over meows a lot over on the right hand side i can click the pencil to edit that item or i should say that document and notice that the name is a string of text the species is a string of text but the age we would want that to be a number instead of a string of text so you can just click on this menu and choose let's go with int 32 click update cool so that's just something to be aware of normally though we're not going to be entering data manually like this through the mongodb website normally we're going to be adding data programmatically with javascript commands and in that case mongodb can set the data type for properties automatically based on the type that a property is in javascript at this point let's learn how to look up or query specific data from the database so up above our results we have this filter bar and let's just start typing in here let's give it a javascript object and let's say we only want to see the cats in the database so we really just sort of describe the types of objects that we want to return so we'll say an object where species has a value of cat so now if i click the find button cool so instead of all six that only returns three documents the ones that are cats change this to dog cool okay what if we only want to see dogs that are a certain age so we could say comma have another property of age and let's say only dogs that are two years old cool so now we're just getting the two dogs instead of all three dogs now instead of looking for only a specific number we could also say less than or greater than so for example imagine we want any dog where the age is greater than four instead of just this simple value here we can actually have another object so another pair of curly brackets and then just say dollar sign greater than or sorry not greater than just gt colon and then let's say four push enter cool so now it only returns the one dog where the age is greater than four you get the idea cool so what else can you really do with a database well really it all boils down to the crud acronym crud which stands for create read update and delete create is just when you add a new document into the database read is what we just performed right we queried the database for specific data update is simple enough right you can just click on if you clear out the filter find all my items again update would just be if you wanted to update a particular item you could hover over it click the pencil make a change and save that change that's an update and then delete would be just clicking the trash icon on one of these documents okay now at this point we can perform all four of those crud actions very easily this is great however the visitors of our sites and apps they don't have access to this mongodb dashboard right instead they're just going to be visiting our express server so what we need now is a way to programmatically or remotely perform these crud actions on this database right we want to be able to perform those actions within our node.js code so right now let's jump over to a text editor i've already created a new empty folder on my desktop named mongodb nodetest so you can create a folder and follow along let's go ahead and start by installing a package so in the command line let's actually we can begin with npm init dash y so that's going to give us a package.json file and let's begin by installing the official mongodb package this will allow node to connect to a mongodb database so it's just npm install the name of the package is aptly named it's just mongodb okay cool now let's go ahead and create a file and try to connect to our database so i'm just going to create a new file you could name it anything but i'll name it index.js right and so we're just going to write a little bit of node code now so let's go ahead and import or require in the mongodb package so const you could name it whatever i'm going to name it mongodb equals and then just require in mongodb okay and now we just want to connect to our database so we can say mongodb and it has a method so dot connect inside these parentheses let's give it two arguments so a comma b is placeholders so this first argument is a connection string so this tells mongodb which database we want to connect to and then also we can include a username and password so that it knows that it can trust us and actually let us connect then this second argument we can give it a callback function so this will run once the connection has actually been established because we don't know how long that's going to take so let's actually start with this second argument here let's turn the b placeholder into a function you could use an arrow function but just to be as clear as possible i'm going to actually spell out an anonymous function so function parentheses currently brackets inside these parentheses let's have two parameters err for error and client you could actually name these whatever you want these are just sort of the industry standard names the idea though is that inside the body of this function we can use client to actually start working with our database but let's not get ahead of ourselves before we can do anything with our database we need to make sure that we give it a valid connection string right which database in the world are we trying to connect to and do we have permission to even access it now if you installed mongodb locally on your personal computer you would use some sort of local host value here but in our case since we used the mongodb atlas cloud service we can look to them to give us a connection string value so back in your mongodb dashboard in the left-hand sidebar i want you to click on database access okay so we have this tab called database users and we just need to create a user the idea is that this one cluster can have multiple databases and maybe you want to create different users that only have access to a particular database so let's just go ahead and create a new database user we can use the default password authentication method so just choose a username maybe i'll give it a username of youtube lesson okay then choose a password i'm just going to use this auto generate secure password option now be sure to copy and paste this or store it somewhere so that you know what it is later so i'm just going to copy that to my clipboard and then off in a separate text file somewhere or in a new tab in vs code just temporarily paste that in so you have a copy of it okay and then let's scroll down what kind of privileges do we want to give to this user i'm just going to say read and write to any and all databases cool and just scroll down click add user so now we can use this database user and the password you just chose we can use that within our connection string value here to actually get access to the database within node so check this out if we go back to our dashboard and click on clusters basically just go back and try to view our database instead of clicking collections to actually view our databases and collections instead let's click this connect button cool now before we ask for it to give us a connection string we do want to allow sort of any ip address in the world in the real world you would only want to let maybe a specific server access your database but because we're trying to access it from both our local computer and i have no idea if you're going to use heroku or volterr or digitalocean or maybe you're using netlify so it's going to be connecting from an aws lambda function since i have no idea what i p address you want to connect your database from what we can do for now is just click this allow access from anywhere option so that should be an ip address of 0.0.0.0.0 right just sort of a wild card allow any and all ip addresses to connect to our database so let's click this add ip address button cool and now we are ready to actually get that connection string that we need so we can click choose a connection method let's use this connect your application just make sure that your driver here is set to node.js and then this value here is what we're interested in so just go ahead and copy that to your clipboard okay back in vs code you could enter that directly right here but what i like to do is just maybe create a variable say const connection string equals quotes and then paste in your clipboard okay and then you can just point towards that for this first argument now we're almost done you do need to put in your password for that database user so you would also get rid of the less than right before the word password here and get rid of the greater than after password so this part that i've highlighted actually include your specific password that you chose or that it generated for you once you do that finally at the very end here or at least towards the end we see this less than database name db name greater than you'd want to replace this with the specific database you're interested in so in my case close out of this and go to my collections i named my database youtube lesson so that's what i'm going to put there i'm going to get rid of the less than and greater than and the db name and just say youtube lesson okay and then again also be sure to do the same thing hollow out your password i'm not going to show you my password but actually instead i'm going to show you the way that you would protect your connection string in real life so the way that we've done it here will work however this would require you to have your private connection string and password living in your source code meaning this is going to get pushed up to github or bitbucket and what if you accidentally set your github repo to public or what if somehow your repo or source code was leaked well your entire database would have been compromised it would be a nightmare so it's a best practice to never have super sensitive information like this directly in your source code so instead i know this is a bit of a tangent this doesn't have anything to do with mongodb directly but it is super important so i want to show you this instead in the project folder let's create a new file and we need to name it exactly this dot env so we can store environment variables in this file let me show you how this works so you just make up a name for variable and it's all uppercase so you could choose anything you could say pizza but i'm going to say connection string and then you don't even need a space you just say equals and then you don't even need to wrap the value in quotes you just paste in the value so that's actually what i'm going to do here right this connection string you don't even need the quotes around it just the value that you copied and pasted from mongodb just paste that here right just like this all uppercase equals no quotes okay now off camera i'll go ahead and put in my password here but you do that as well and then go ahead and save this file okay now before we move forward in order for this to actually be secure sort of the whole point of this file we would tell git to ignore this file so that way when you push your code up to github or bitbucket your private data here is ignored so just create a new file in your repo folder call it dot git ignore and then just be sure to include env hit save so now when you turn this folder into a git repo and you push it your private environment variables will actually stay private they will not be in source code okay now how do we actually use this environment variable of connection string well we just need to install a package so in the command line we just say npm install its name is dot d o t env press enter now watch how easy this is back in our index.js file we just up on the very first line let's import that package so just const.env equals and then require it and then right below that on a new line just say dot env and call its config method that's it so now when we're actually trying to connect when we want our connection string here to access that environment variable we just say process dot env dot and then we named ours all uppercase connection string now before we jump back to the actual topic at hand which is mongodb one last note on the environment variables this will work locally for us because we have the env file on our hard drive but you might be wondering brad how is this going to work when i push my code up to heroku or netlify right because if this dot env file is ignored then how would heroku or netlify know my connection stream well that's a great question so heroku and netlify are both different but they have places in their dashboard for for the particular project you're working on where you can set up environment variables so for example in heroku if you go into a project and then click on settings down just a little bit you'll see this config vars reveal config vars and if you reveal that you can set up key value pairs so this would just be all uppercase connection string or whatever we named it right and then you just include the value here this way those ultra ultra important secret password values they don't exist in your source code which could potentially get leaked so that's heroku netlify has something very similar right so for a particular project you can just click on site settings okay then down here we're looking for this build and deploy area and then if you scroll down you have to scroll down pretty far but you'll see environment environment variables cool so i know that was a huge tangent but that is sort of the best practice way to keep your private data ultra secure okay let's get back to mongodb so the whole idea is now inside the body of this function we can use client this is the database client this is how we can actually work with the database so let's create a variable you could name it anything i'll name it db and just say that it equals client and then i'm going to call a method that it has called db since we didn't provide an argument in these parentheses it's just going to give me the database that you specified towards the end of your connection string cool so now we have this variable of db we can start to do some really useful things with it for starters let's just try to retrieve any and all pets from the pets collection so let's do this let's say db dot collection that's a method and then you tell it which collection you're interested in so let's say quotes pets right that's the collection we want and then on that we can call a method of find now if you wanted to find just the cats or just the dogs you could use that same query syntax we saw earlier that we used in the mongodb website but if we just want all of the pets in the collection you can just leave this blank okay now that's going to return data that makes sense to mongodb but doesn't really make sense to us as a human developer so instead what we want to do at the very end of this is call a method of dot 2 array right so that's just going to give us an array with basically json data cool now there's just one more detail we need to remember and that is that we have no idea how long this database action is going to take to complete it could take 10 milliseconds or it could take 10 seconds who knows so this is actually going to return a promise now there's a lot of different ways you could handle this but what i'm going to do is just make sure that we're working inside an asynchronous function so the nearest parent function right here right before that just add the word async okay now at the start of this line let's just store its results in a variable so let's say maybe const results equals and then right before this since this is going to return a promise just say await cool so now the next line of code will actually wait for that to finish so we can just say maybe console.log the results okay so let's take this for a test drive i'm going to save this file make sure your env file was also saved and we just jump into the command line and we just run this file right so it's node and then the name of my file is index.js push enter cool and there you see json data for the six pets in my pets collection now up above those actual results you'll see this warning it's just letting you know that in the newest version of mongodb or i should say in a future version they're going to deprecate a certain feature so if you want to make this warning go away all you need to do is after this first argument of the connection string and in between the second argument just add one more argument so i'll add a comma here and then the second argument is just a configuration object so if you just say use unified topology i have no idea if i pronounce that correctly or not but just set it to true and i'll be honest i have no idea what this setting actually does if you save that and then try your task again so i'm gonna press ctrl c to stop that task and then to fire it up again just node index.js cool now you don't see that warning you just see these six pets in the database uh let me press ctrl c once again now the reason i'm having to press control c is because we didn't tell this task to stop uh or actually i should say we didn't tell it to disconnect from the database so after we're done we can say client.disconnect and call that method oops sorry about that it's actually not disconnect the method name is close so if we try this out again cool you can see you get the data and then the task gracefully actually finishes now as we'll see towards the very end of this video when you're actually working with an express server there's no need to manually close the database connection like this since your server is just listening for incoming requests to different urls ongoing you would just want to keep the database connection open right but for this simple node task that has nothing to do with a server or express this is how you would manually close the connection okay and if we only wanted to query for the dogs in our collection inside the find parentheses you could just give it an object and say species colon cat dog or whatever you're looking for in particular right so if i save that and run the task again cool i just get the three dogs in the database if you want to learn about more advanced mongodb queries i'll provide a link to their documentation in the description for this video anyways let's get back to the crud acronym right create read update and delete we want to be able to perform those actions programmatically from within node here so we just saw the r in crud right we successfully read a bit of data now let's try the c right we want to create a document in the pets collection from within node here so let me comment out this line and let's try to add maybe a new dog document to the pet's collection so you would just say db right that's our database and again call its collection method we want to work with the pets collection if you were going to be working with this collection many many times you could create a variable that was just this right so you could say const pets equals this and then down below you could just keep reusing that variable right so then i could just say pets dot and then the method to add or create one new document is insert one okay in these parentheses you just give it a javascript object so curly brackets let's say name should be always hungry species is a cat age 4 okay now this is going to return a promise so at the start of this we could await that promise right so we want to wait until this action is complete and then we could log a message to the console that says added new animal now in the real world you would want to wrap this in a try catch block so that if we did run into an error we could handle it gracefully but we've already seen try catch earlier in this series so for now let's just test this out i'm going to save this in the command line just run node index.js okay we see added new animal now to really test this out back in mongodb you can just refresh your pet's collection or just click the green find button again cool so we see that we now have seven documents and if i scroll down there is that new always hungry cat or to really test it out you could have just used your find method right within our node code okay so in terms of crud we've seen how to create an item we've seen how to read data now let's try updating an existing item from within node here let me clean up this code that we're not using anymore okay so imagine we want to update an existing item so for example imagine that item that i just created the always hungry cat document imagine i want to change its name to usually hungry so back in our code we could just use our pets variable and it has a method of update one so in the parentheses we give it two arguments a comma b is placeholders the first argument is just us saying which document in the collection do we want to update so you can use the same syntax here as you would use with the find method so in other words you could say let's find the document where the name is always hungry or what i would recommend is let's do it based on the id so let's say let's find the document that has this exact unique id now your id number is going to be different than mine but the idea is i just want you to go into your mongodb database and copy this string of characters for a hypothetical document that you want to update right again yours will be different than mine let me just grab this value though okay so now back in our code for this first argument get rid of the a let's have an object so let's have a property of underscore id colon and now instead of just having a string of text and pasting that in we actually want to use a mongodb tool so let's say mongodb for the package that we've already imported and it has something inside it so dot called object id and parentheses to call that and again that's an uppercase for object and then an uppercase i but a lowercase d okay now in these parentheses you can have quotes and then just paste in your unique id okay so this first argument is us just saying which item we want to update now this second argument instead of the placeholder b just give it an object and let's use the set operator so that's dollar sign set then colon and then you give that an object and now you can specify any of the properties that you want to update so this way we're not overwriting the entire document because imagine what if this document had maybe like 20 or 30 properties we don't want to have to spell out the entire document again we're just setting the exact couple of properties that we want to change so i'm just going to change the name and let's set it to usually hungry okay at the very start of this line i'll await i'll wait until it's actually finished and then we could console.log updated document again in the real world you'd want to wrap this in a try catch block but let's test it out so nodeindex.js let's go check in mongodb so if i refresh my collection click the find button scroll down cool so now it's usually hungry and finally let's practice deleting an item from within our node code so i'm going to delete this usually hungry cat right so i already know what its id is it's still in my clipboard you could probably even guess the method name i'm going to use so instead of update1 i'm going to use a method called delete1 this first argument can stay the same that's the item i'm interested in and then i can just get rid of the second argument okay let me change the console.log to document deleted let's give this a try cool document deleted back in mongodb if i click find or refresh instead of seven documents it's back down to six once again okay now that does wrap up all of the hands-on coding that i wanted to cover in this video so now let's take a minute to put this into context because you might be thinking to yourself okay so i can perform these operations within a node file but how would i actually connect the dots and connect to a database within an express server well in this bootcamp i don't want to spoon feed everything 101 percent so in earlier videos we already learned how to set up an express server so i think it would be fun for you to sort of take what you've learned in this video and go plug it back into an express app now i will admit it can be a little bit tricky in terms of making sure you connect to the database first before listening on a port within express but then at the same time being able to reuse your database connection across multiple files so if you get stuck and you're really confused trying to actually implement database actions within an express app i've set up this repo that you can take a look at there will be a link to this in the description for the video but it's just my github account and then it's express mongodb example so a way that i'll typically set it up is this db.js file is what you actually launch first right so that's what you start up with node or if you're using heroku that's the file that you would initially launch inside that file that's what's opening the connection to our database but then you might want to split up your code into separate files so i'm exporting the database client so that if i want to be able to perform a database action in any other file in my project i can just import this db.js file and access it like that also though within this function once i've actually waited to connect to the database only then am i importing the express app and then telling it to begin listening okay and then the other slight change if we go back and look at the app.js this file is just for express related code and you'll notice that at the bottom instead of telling it to listen with app.listen instead i'm just exporting the express app and that way the database file can tell the express app to start listening once that database connection is up and running so i encourage you to maybe look at these files for guidance and just try to set up a basic express app right where maybe you have a traditional html form and then you can listen for a post request for when that form gets submitted you can look at request.body and maybe have the user fill out different fields and then you could create a javascript object using those values and then store it in a database and you could also practice sanitizing and validating the data before letting it get into your database so you could just use simple javascript if else statements to make sure that the user input sort of at least vaguely matches what you want it to or would expect it to also a quick note if you're getting really creative and the gears are turning in your mind and you're like i'm going to use this to set up user registration i'm going to start storing usernames and passwords in a user's collection in my database absolutely go for it however i do want to have one quick public service announcement never ever ever store plain simple text user passwords in your database right because if for any reason if the security of your database was compromised you don't want to leak all of your users passwords so and this is really extra credit because we're going to talk about this in the very next video but if you want to start experimenting with usernames and passwords be sure that you use an npm package called bcrypt you can see i'm on the website for the official bcrypt package on npm and what this package does is it lets you hash someone's password so you call bcrypt.hash you give it the actual password that your user typed in that they want to use as their password but you would never want to store that actual plain text in your database right and then a common value for salt rounds is 10 you give it a function and then inside that function you can access the hash that it generates the idea with a hash is it's sort of a one-way street there is no way to decrypt the hash value back to the plain text an analogy i've heard is that it's like once you burn a piece of paper and there's just ashes there's no way to turn those ashes back into the piece of paper so then you could store that hash value in your database and then when the user tries to log in in the future you can just use the bcrypt compare function right so you take the password that they're trying to log in with and you compare it to the hash that's in the database and then this callback function will have result either being true or false if it's a match or not cool now even if you do experiment and set up a registration form where users choose a username and password you'll still get stuck and have no real way of remembering or trusting that user for subsequent requests this is because we haven't learned about user authentication yet but luckily that's exactly what we're going to cover in our very next video one other super quick note before we talk about our next steps and where we go from here i also have this gist that i've set up and this is if you want to try connecting to your database from within a netlify serverless function right an aws lambda function so there will be a link to this in the description for the video so you could use the contents here as a file in your netlify functions folder and this is an example of how you could connect to a database and then be sure to close the connection once you've got your data cool that is going to bring the technical aspect of this video to a close so where do we go next from here well like i said even if you did set up a registration form and a login form and you made sure that the user typed in their correct username and password well that would be great but as soon as they refreshed the page for any subsequent requests you would have no way for the server to remember them or trust them that they are who they say they are this is because http requests at their core are stateless now luckily uh there are ways for us to get around that and to have the server remember or trust you and that's exactly what we're going to learn about in our next video so we'll cover topics like cookies local storage sessions json web tokens and we'll kind of see their differences their similarities how they all work together to create something meaningful i think it'll be a lot of fun if you're enjoying this boot camp series so far as always i'd appreciate it if you could share the link with your friends and family take care i'll see you in the next one
Info
Channel: LearnWebCode
Views: 15,055
Rating: 4.9563184 out of 5
Keywords:
Id: EcJERV3IiLM
Channel Id: undefined
Length: 43min 28sec (2608 seconds)
Published: Mon Nov 16 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.