This will show the database name, number of collection and documents in the database. To get stats about MongoDB server, type the command db.stats() in MongoDB client. This will give you a list of commands as shown in the following screenshot. To get a list of commands, type db.help() in MongoDB client. This will connect you to running MongoDB instance. To use MongoDB run the following command. Make sure to install the latest version always. In the above installation, 2.2.3 is currently released MongoDB version. Next install the MongoDB by using the following command − Now issue the following command to update the repository − Sudo apt-key adv -keyserver hkp://:80 -recv 7F0CEB10Ĭreate a /etc/apt//mongodb.list file using the following command. Run the following command to import the MongoDB public GPG key − Next time when you run MongoDB, you need to issue only commands. This will show that MongoDB is installed and run successfully. Now to run the MongoDB, you need to open another command prompt and issue the following command.Ĭ:\Program Files\MongoDB\Server\4.2\bin>mongo.exeĬonnecting to: mongodb://127.0.0.1:27017/?compressors=disabled
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |