![]() ![]() The use Database_name command makes a new database in the system if it does not exist, if the database exists it uses that database: use gfg Below is an example of how to make a new database: ![]() Now you can make a new database, collections, and documents in your shell. Now, you are ready to write queries in the mongo Shell. Important Point: Please do not close the mongod window if you close this window your server will stop working and it will not able to connect with the mongo shell. Now, our mongo shell will successfully connect to the mongod. So, keep that mongod window and open a new command prompt window and write mongo. Step 13: Now we are going to connect our server (mongod) with the mongo shell. Now, this time the MongoDB server(i.e., mongod) will run successfully. Again open the command prompt and run the following command: mongod Step 12: Now, Open C drive and create a folder named “data” inside this folder create another folder named “db”. When you run this command you will get an error i.e.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |