About MongoDB:
??? MongoDB is a product between a relational database and a non-relational database, and is the most versatile and most like relational database in a non-relational database. The data structure he supports is very loose and is a JSON-like Bjson format, so you can store more complex data types. MONGO's biggest feature is that the query language he supports is very powerful, and its syntax is a bit like an object-oriented query language that almost implements most of the functionality of a relational database single-table query, and also supports indexing of data.
? In this experiment we will install the mongodb3.6.6 database and a series of operations
1. Install: Configure the Yum source repository
???????????????????????????????
????????????????????????????? Add the following content:
?????????? [Mongodb-org]
??????????? Name=mongodb Repository
??????????? baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
??????????? Gpgcheck=1
??????????? Enabled=1
??????????? Gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
????????????????????????????????
????????????????????????????????
?????????????????????????? Next Install:
??????????????????????????????????? ???
???????????????????????????? Configure the configuration file:??
??????????????????????????????????
???????????????????????????????? ? #修改监听地址和监听端口
???????? Start the service:
??????????????????????????????????
????????????????????????????? Enter MongoDB:
?????????????????????????????????????
???????????????????????????? To view the database:
???????????????????????????????????????
??????????????????????????? Insert data into the collection:
??????????????????????????????????????
?????????????????????????????? To view the contents of the collection:
??????????????????????????????????????
?????????????????????????????? To modify the data in the collection:
??????????????????????????????????????
??????????????????????????????? Insert 100 Data:
?????????????????????????????????????
????????? View data:
???????????????????????????????????????
?????????? Find the 10th data:
?????????????????????????????????????????????
? 2. Import and Export: Export the collection in database school info:
??????????????????????????????????????????
??????????????????????????????????? Import into the database:
????????????????????????????????????????????
???????????????????????????????????????????? #可以看出, Info1 is already in school.
3. Backup and Recovery:
???????????????????????????????????????????????
4. Clone collection:?
????????????????????????? Create a data file and log file storage location:
??????????????????????????????????????????
?????????????????????????? To modify a configuration file:?????
????????????????????????????????????????????
??????????????????????????????????????????? ??????????????????????????????????????????????
????????????????????????????????????????????
????????????????????????? Launch the instance and enter the port:
??????????????????????????????????????????
???????????????????????????? Clone collection:
????????????????????????????????????????
?????????????????????????? Copy database:
?????????????????????????????????????????
MongoDB installation, configuration, startup and related operations