to install MongoDB in a Linux environment:
even version is generally considered stable version such as 1.6.x, odd version for the development version such as 1.7.x
32bit MongoDB Max can store 2g of data, 64bit No limit
Method 1:
Terminal execution:
installation Server: sudo apt install mongodb-server
install client: sudo apt install mongodb-clients
Method 2:
1 Download the appropriate version of the website
2 Unzip to the/user/local/directory: TAR-ZXVF Install the package/user/local/mongodb
3 Add executable file to path path: Export path=/usr/local/mongodb/bin: $PATH
Basic Operation:
Server:
Start server: sudo service mongodb start
Stop server: sudo service MongoDB stop
restart server: sudo service mongodb restart
Note:
Some Linux systems are sudo service mong OD Start/stop/restart
Some people are sudo service MongoDB start/stop/restart
client:
connecting server:
MONGO
View parameters:
MONGO--help
exit MONGO Service:
exit or Ctr + C
View the database currently in use (the test database is used by default after login):
db
View all databases (physically created databases):
show dbs
switch database (use not present Library will temporarily build the library in memory, and creating the collection file will automatically create the database physically):
Use library name
Delete the currently used database (do nothing if the database does not exist):
Db.dropdatabase ()
How to install MongoDB under Linux and basic operation under terminal