博客
关于我
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/

    你可能感兴趣的文章
    Presto(二)开启安全认证
    查看>>
    Pricing procedure Steps and Details in SAP MM (from SCN)
    查看>>
    Prim 算法在不同权重范围内的性能分析及其实现
    查看>>
    Primace 5.0软件与KEIL单片机软件联合在线仿真步骤
    查看>>
    Prime Distance
    查看>>
    Prim求MST最小生成树
    查看>>
    Prim算法与Kruskal算法在均匀分布权重图中的性能比较
    查看>>
    Prim算法在加权连通图中的简单实现
    查看>>
    Prim算法详解及C代码示例
    查看>>
    pytorch中让数组显示更多的数字 torch.set_printoptions参数详解 numpy也是这个函数
    查看>>
    pringBoot Controller接收参数的几种常用方式
    查看>>
    printf()函数
    查看>>
    PyTorch中的自定义权重初始化
    查看>>
    printf格式字符串和输出列表个数及类型不匹配案例
    查看>>
    printf的格式控制字符串
    查看>>
    PrintStream概述
    查看>>
    Prismix:Prisma 架构混合器,为复杂项目而生
    查看>>
    pritunl服务安装及配置
    查看>>
    Private Destructor
    查看>>
    private和protected能同时修饰成员变量吗_天天用注解你了解注解是怎么实现的吗?...
    查看>>