mongodb的使用(二):撸代码神器

神奇工具

我是不是省略了mingodb的安装部署?嗯,是的,因为我有现成的环境,哈哈!

这里介绍一下第三方工具的使用,让你的操作更方便哦!

MongoDB的客户端工具–nosqlbooster,下载地址:

https://nosqlbooster.com/downloads

为什么要用客户端工具?当然是为了方便啦!哈哈

连接

在这里插入图片描述
在这里插入图片描述

我的mongodb是没有带认证的,所以上面的配置完全满足连接需求,相应的,我的配置文件如下:

查看配置

cat /etc/mongod.conf

配置如下:

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# Where and how to store data.
storage:
  dbPath: /var/lib/mongo
  journal:
    enabled: true
#  engine:
#  wiredTiger:

# how the process runs
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile
  timeZoneInfo: /usr/share/zoneinfo

# network interfaces
net:
  port: 27017
  bindIp: 0.0.0.0  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.


#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options

#auditLog:

#snmp:

在这里插入图片描述

如上,采取的是默认配置,只是修改了bindIp,使得他支持外部IP连接。

重启mongodb,使得配置生效:

systemctl restart mongod

使用

在这里插入图片描述
在这里插入图片描述
如此一來,就可以在客戶端擼代碼了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Lion King

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值