This is a simple tutorial on how to Install MongoDB on your PC.
About MongoDB
MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc. and is published under a combination of the GNU Affero General Public License and the Apache License.
source: wikipedia
Tutorial:
Download MongoDB.
Download
Select the Community Server and specify your Operating System (Windows, Linux, OSX, Solaris) to download.Extract the folder, rename it to
mongo
and move it to your user directory.
Create a new Directory in your user directory alongside mongo called
mongo-data
. This is for storing the actual data that is inside the database.Using your terminal, cd to the bin in the mongo directory and enter this command below. This is to start up the server.
./mongod --dbpath ~/mongo-data
you should see something like this (below)
- Now, lets test if the installation is working. Open another tab on your terminal (CMD T), the bin directory would still be there. Then enter
$ ./mongo
. We should see something like the screenshot below.
With this , we can now type in some commands.
first, lets insert some text.
> db.Todo.insert({text: 'learn mongodb'})
This inserts learn mongodb to the database.
Result:
lets list our todo. use the command below.
> db.Todo.find()
Result:
If all these commands work perfectly, your MongoDB was correctly installed.
Posted on Utopian.io - Rewarding Open Source Contributors
Upvote and Follow you. Follow me and upvote all my posts. Comment 'something' on any of my post and i'll do the same. Come lets earn together @byltc
Upvote and Follow you. Follow me and upvote all my posts. Comment 'something' on any of my post and i'll do the same. Come lets earn together @byltc
Your contribution cannot be approved because it does not follow the Utopian Rules.
This tutorial is too trivial - it involves an installation process, which is usually really easy to follow by yourself. On top of that, hundreds of these can also be found online with a simple google search.
You can contact us on Discord.
[utopian-moderator]