How to install MongoDB in FreeBSD

To install MongoDB in FreeBSD

MongoDB is an open-source, cross-platform, document-oriented database which stores data in JSON-like documents. The main features of MongoDB are Ahoc queries, indexing, load balancing and file storage. Installation of MongoDb in FreeBSD is explained in this article.

Installation of MongoDB

Run the following command to update the repository.

root@linuxhelp:~ # pkg update -f 
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01    
Fetching packagesite.txz: 100%    5 MiB 411.6kB/s    00:14    
Processing entries: 100%
FreeBSD repository update completed. 25366 packages processed.


Then install MongoDB by using “ pkg install” command.

root@linuxhelp:~ # pkg install mongodb 
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):
.
.
.
Using existing group ' mongodb' .
===>  Creating users
Using existing user ' mongodb' .
[1/1] Extracting mongodb-2.6.12: 100%


Enable the MongoDB service by adding the following line at the bottom of rc.conf file.

root@linuxhelp:~ # nano /etc/rc.conf 
mongod_enable=” yes” 


Start the MongoDB service by running the following command.

root@linuxhelp:~ # service mongod start 
Starting mongod.

To launch MongoDB

Open the terminal and type MongoDB.

root@linuxhelp:~ # mongoDB 
MongoDB shell version: 2.6.12
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type " help" .
For more comprehensive documentation, see
    http://docs.mongodb.org/
Questions? Try the support group
    http://groups.google.com/group/mongodb-user
>  use linuxhelpdb
switched to db linuxhelpdb
>  db
linuxhelpdb
>  show dbs
admin  (empty)
local  0.078GB
>  exit
bye
Tag : Mongodb
FAQ
Q
What does the leaf mean in the MongoDB logo?
A
Our founders believe that coding should be natural, and so should use a database. They want the experience of using MongoDB to be simple and natural. Thus, the leaf.
Q
what are the main factor to be using the MongoDB?
A
MongoDB is an open-source, cross-platform, document-oriented database which stores data in JSON-like documents. The main features of MongoDB are Ahoc queries, indexing, load balancing and fil
Q
Does MongoDB scale?
A
Tens of thousands of organizations use MongoDB to build high-performance systems at scale. Organizations ranging from Fortune 100 enterprises to the most agile startups rely on MongoDB
Q
Is MongoDB offered as a hosted service?
A
Yes. MongoDB Atlas is a cloud-hosted database-as-a-service. For more information, please visit the MongoDB Atlas docs
Q
Does MongoDB support SQL?
A
Not directly, no. However, MongoDB does support a rich query language of its own. For examples on using MongoDB’s query language, see MongoDB CRUD Operations

You can also use the MongoDB Con