Skip to main content

MongoDB - Create Database

MongoDB - Create Database

  • If you want to check your databases list, use the command show dbs

  • Your created database (mydb) is not present in list. To display database, you need to insert at least one document into it.

  • MongoDB use DATABASE_NAME is used to create a database.

  • > use database_name

     Let's take an example here

    if we want to create a database name like school then
    
    > use school                                                           
   
 To see databases :

    >  show dbs                                                            

Your created database (mydb) is not present in list. To display database, you need to insert at least one document into it.



 


Comments

Popular posts from this blog

MongoDB: Data Types

MongoDB Data Types   : MongoDB stores documents on disk in the BSON serialization format. BSON is a binary representation of JSON documents, though BSON data format provides more data types than JSON.

Next-gen JavaScript Features

In this module, I provided a brief introduction to some core next-gen JavaScript features. Here’s a quick summary! let & const Read more about let :  https://developer.mozilla.org/en-US/  docs/Web/JavaScript/Reference/Statements/let Read more about const:  https://developer.mozilla.org/enUS/docs/Web/JavaScript/Reference/Statements/const let and const basically replace var . You use let instead of var and const instead of var if you plan on never re-assigning this “variable” (effectively turning it into a constant, therefore). ES6 Arrow Functions  Read more:  https://developer.mozilla.org/en-US/docs/Web/  JavaScript/Reference/Functions/Arrow_functions Arrow functions  are a different way of creating functions in JavaScript. Besides a shorter syntax, they offer advantages when it comes to keeping the scope of this keyword (see here). Arrow function syntax may look strange but it’s actually simple. function callMe(name) { console.log(name); } whic...