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