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.

JavaScript important array functions

  Not really next-gen JavaScript, but also important: JavaScript array functions like   map()   ,   filter()   ,   reduce()   etc. You’ll see me use them quite a bit since a lot of React concepts rely on working with arrays (in immutable ways). The following page gives a good overview of the various methods you can use on the array prototype — feel free to click through them and refresh your knowledge as required:  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array map()  =>  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map find()  =>  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find findIndex()  =>  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex filter()  =>  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Glo...