1.启动、停止和重启mongodb服务

brew services start mongodb  ---启动

brew services stop mongodb --停止

brew services restart mongodb --重启

2.mongo cli

The mongo shell is a component of the MongoDB distributions. Once you have installed and have started MongoDB, connect the mongo shell to your running MongoDB instance.

Ensure that MongoDB is running before attempting to start the mongo shell.

You can run mongo shell without any command-line options to connect to a MongoDB instance running on your localhost with default port 27017:

mongo

To explicitly specify the port, include the --port command-line option.

mongo --port 28015

To explicitly specify the hostname and/or port,

You can specify a connection string. For example, to connect to a MongoDB instance running on a remote host machine:

mongo mongodb://mongodb0.example.com:28015

You can use the command-line option --host <host>:<port>. For example, to connect to a MongoDB instance running on a remote host machine:

mongo --host mongodb0.example.com:

You can use the --host <host> and --port <port> command-line options. For example, to connect to a MongoDB instance running on a remote host machine:

mongo --host mongodb0.example.com --port 

最新文章

  1. Windows Server 2012部署Enterprise Solution 5.4
  2. 修改/etc/profile文件
  3. [转]理解OAuth 2.0
  4. Leetcode: Graph Valid Tree &amp;&amp; Summary: Detect cycle in undirected graph
  5. 移动设备和SharePoint 2013 - 第3部分:推送通知
  6. mysql 非安装版本就可以用, 用于打包用
  7. MYSQL日常操作命令再熟悉
  8. Number Sequence(KMP,判断子串 模板)
  9. 关键字instanceof和final
  10. 聚类算法初探(六)OPTICS
  11. Jquery的AJAX应用详解
  12. Java学习点滴——Integer缓存
  13. Linux基础知识梳理
  14. Android高级工程师面试实战,您会挂么?
  15. frost_vex_01
  16. Opencv-Python学习笔记(一)
  17. BZOJ2150部落战争——最小路径覆盖
  18. Android手机用KSWEB搭建Web服务器成功安装WordPress
  19. 读书笔记(04) - 错误监控 - JavaScript高级程序设计
  20. Java虚拟机 - 类加载机制

热门文章

  1. composer设置国内镜像
  2. Spring AOP源码分析(三)创建AOP代理
  3. Redis(五)主从复制
  4. SSL证书更换(具体路径可参考iRedMail.tips文件)及邮件服务器架构
  5. UVa 10377 - Maze Traversal
  6. 在hue平台上使用oozie工作流调度
  7. 让你的:active好好工作
  8. Memcached 集群架构问题归纳
  9. SCP命令小例子
  10. [BZOJ4476][JSOI2015]送礼物[分数规划+单调队列]