博客
关于我
MongoDB安装和入门
阅读量:229 次
发布时间:2019-02-28

本文共 2360 字,大约阅读时间需要 7 分钟。

MongoDB????

?????????????????????SQL???????????????????????????????????????????NoSQL??????MongoDB???????????????2019?????SQL??????????????????????????????????????????????????MongoDB?


MongoDB?????

MongoDB???????????????????????????MongoDB????????????????????????????????????????????????????????????????????????????????????????????


MongoDB??

Windows??

  • ??MongoDB??????????????????
  • ?????.msi??????????
  • ?????????????MongoDB???D:\MongoDB\Server\????
  • ????????mongod.cfg???????????????????
  • Linux??

  • ??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

  • MongoDB????

    ????????

  • ??Robo 3T??MongoDB????
  • ???????????????????????????chapter_1?
  • ????????????????????????????????example_data_1?
  • ????

  • ?C????????????????
    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})

  • Robo 3T??

    ??Robo 3T

  • ??Robo 3T??????????????????
  • ????????????????
  • ??MongoDB

  • ??Robo 3T????+?????????????
  • ????????IP?????????IP?????????
  • ??Robo 3T

  • ???????????????????
  • ???????????????????

  • MongoDB????

    ????

  • ???????

    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/

    你可能感兴趣的文章
    Objective-C实现y = x的平方函数的积分运算(附完整源码)
    查看>>
    Objective-C实现z-algorithm算法(附完整源码)
    查看>>
    Objective-C实现Zeller 的同余算法 (附完整源码)
    查看>>
    Objective-C实现zellers congruence泽勒一致算法(附完整源码)
    查看>>
    Objective-C实现Zero One Knapsack零一背包计算算法(附完整源码)
    查看>>
    Objective-C实现一个Pangram字符串至少包含一次所有字母算法(附完整源码)
    查看>>
    Objective-C实现一个stack算法(附完整源码)
    查看>>
    Objective-C实现一个通用的堆算法(附完整源码)
    查看>>
    Objective-C实现一分钟倒计时(附完整源码)
    查看>>
    Objective-C实现一阶高斯滤波(附完整源码)
    查看>>
    Objective-C实现万年历(附完整源码)
    查看>>
    Objective-C实现三次样条曲线(附完整源码)
    查看>>
    Objective-C实现上传文件到FTP服务器(附完整源码)
    查看>>
    Objective-C实现不重复字符的最长子串算法(附完整源码)
    查看>>
    Objective-C实现两个字符串由相同的字母组成但排列方式不同(字符串字谜)算法(附完整源码)
    查看>>
    Objective-C实现两个日期之间的天数(附完整源码)
    查看>>
    Objective-C实现两个栈实现队列算法(附完整源码)
    查看>>
    Objective-C实现两个队列实现栈算法(附完整源码)
    查看>>
    Objective-C实现两数之和问题(附完整源码)
    查看>>
    Objective-C实现中介者模式(附完整源码)
    查看>>