本文共 2360 字,大约阅读时间需要 7 分钟。
?????????????????????SQL???????????????????????????????????????????NoSQL??????MongoDB???????????????2019?????SQL??????????????????????????????????????????????????MongoDB?
MongoDB???????????????????????????MongoDB????????????????????????????????????????????????????????????????????????????????????????????
D:\MongoDB\Server\????mongod.cfg?????????????????????MongoDB YUM??
cat /etc/yum.repos.d/mongodb-org-4.2.repo
????????????????
????????MongoDB?
yum updateyum -y install mongodb-org
??MongoDB???
systemctl start mongod.servicesystemctl enable mongod.service
????????????
systemctl status mongod.service
????????27017???
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 27017 -j ACCEPT
chapter_1?example_data_1?db.getCollection('example_data_1').insertOne({ "name": "???", "age": 17, "address": "??"})Ctrl + R??????????????????????
db.getCollection('example_data_1').find()????????
db.getCollection('example_data_1').find({'age': 23})??????
db.getCollection('example_data_1').find({'age': {'$gt': 21}})???????
db.getCollection('example_data_1').find().limit(5)?????
db.getCollection('example_data_1').find({'age': {'$gt': 21}}).sort({'age': -1})???????
db.getCollection('example_data_1').updateMany({ 'name': '???', 'address': '??'}, { '$set': { 'work': 'DBA' }})?????????
db.getCollection('example_data_1').updateMany({ 'name': '???'}, { '$set': { 'address': '??' }})#### ????
???????
db.getCollection('example_data_1').deleteMany({ 'hello': 'world'})???????
db.getCollection('example_data_1').deleteOne({ 'name': '???'})#### ????
???????
db.getCollection('example_data_1').distinct('age')????????????????
db.getCollection('example_data_1').distinct('age', { 'age': {'$gte': 20}})MongoDB??????????????????????????????????????MongoDB??????????Robo 3T?????????????????MongoDB?????????????????????????????????
转载地址:http://alti.baihongyu.com/