MONGO using the database
Mongod Boot
Mongoimport Importing Data
Boot command: Mongod--dbpath path
--dbpath is the folder where you select the database document
In other words, MongoDB, there are real physical files, corresponding to a database, U disk can be moved. However, to use this database, the database must be turned on, and once it is stopped, the database shuts down automatically.
Link Database command: MONGO
MONGO Syntax:
Show DBS List all databases
Which database is used with the database name (if the use database does not exist, create a new database)
DB View the currently used database
Db.student.insert ({"Name": "Xiaoming", "Age": N, "Sex": "Nan"});
Student is the collection, which stores a lot of JSON
Show Collections View all collections in the current database
Db.student.find () finds all the elements in the current database that student this collection, and find can write some query criteria.
Data cannot be inserted directly into the database, only data can be inserted into the collection (collections). You do not need to create a collection, just write the syntax:
Db. Collection name. Insert ({"name": "Xiaoming"});
To delete a database:
Db.dropdatabase (); Delete current Database