MongoDB Shell (mongo)
https://docs.mongodb.com/getting-started/shell/client/
The mongo shell is an interactive JavaScript interface to MongoDB and is a component of the MongoDB package.
You can use the mongo shell to query and update data as well as perform administrative operations.
Start mongo
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 launch the mongo shell.
On the same system where the MongoDB is running, open a terminal window (or a command prompt for Windows) and run the mongo shell with the following command:
mongo
On Windows systems, add .exe as follows:
mongo.exe
You may need to specify the path as appropriate. //如果配置到环境变量的话,可以直接mongo
When you run mongo without any arguments, the mongo shell will attempt to connect to the MongoDB instance running on the localhost interface on port 27017.
To specify a different host or port number, as well as other options, see mongo Shell Reference Page.
mongo --host localhost --port 27017
mongo --host 192.168.1.18 --port 27017
C:\Users\Administrator>mongo --host 192.168.1.63 --port 10001
MongoDB shell version v3.4.2
connecting to: mongodb://192.168.1.63:10001/
MongoDB server version: 3.4.2
Server has startup warnings:
2017-03-02T17:36:14.784+0800 I CONTROL [initandlisten]
2017-03-02T17:36:14.784+0800 I CONTROL [initandlisten] ** WARNING: Access contr
ol is not enabled for the database.
2017-03-02T17:36:14.785+0800 I CONTROL [initandlisten] ** Read and wri
te access to data and configuration is unrestricted.
2017-03-02T17:36:14.785+0800 I CONTROL [initandlisten]
2017-03-02T17:36:14.785+0800 I CONTROL [initandlisten] Hotfix KB2731284 or late
r update is not installed, will zero-out data files.
2017-03-02T17:36:14.785+0800 I CONTROL [initandlisten]
Help in mongo Shell
Type help in the mongo shell for a list of available commands and their descriptions:
help
The mongo shell also provides <tab> key completion as well as keyboard shortcuts similar to those found in the bash shell or in Emacs.
For example, you can use the <up-arrow> and the <down-arrow> to retrieve operations from its history.
Additional Information
See the following documents in the MongoDB Manual for more information on the mongo shell.
- Shell Quick Reference for more information.
- MongoDB Shell Help
- mongo Reference Page
- mongo Shell Scripting
- Data Types in the MongoDB Shell
MongoDB Shell (mongo)的更多相关文章
- Getting Started with MongoDB (MongoDB Shell Edition)
https://docs.mongodb.com/getting-started/shell/ Overview Welcome to the Getting Started with MongoDB ...
- MongoDB error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js(转)
rror: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js 一般这种情况就是:自己指定的数据库,所以不能.自动加 ...
- MongoDB入门三:MongoDB shell
MongoDB shell MongDB shell是一个功能完备的Javascript解释器,可以运行Javascript程序.也可以用于连接MongoDB服务器,执行脚本,对数据库进行操作.类似于 ...
- MongoDB Shell
MongoDB Shell 1.连接指定主机及数据库 mongo 127.0.0.1:30000/myDB 链接到127.0.0.1的30000端口的myDB 2.启动后连接指定数据库 *.&qu ...
- MongoDB 学习笔记(二)—— MongoDB Shell
MongoDB自带一个JavaScript shell 可以从命令行中与MongoDB交互,功能非常强大.如在上一节最后一张图所看到,可以执行JavaScript程序. 运行Shell 前提是启动Mo ...
- [转载]MongoDB学习(三):MongoDB Shell的使用
MongoDB shell MongoDB自带简洁但功能强大的JavaScript shell.JavaScript shell键入一个变量会将变量的值转换为字符串打印到控制台上. 下面介绍基本的操作 ...
- [MongoDB] - Shell基本命令
在这里,我简单的记录一下MongoDB在shell客户端中使用的基本命令,比如创建/显示数据库,创建集合,删除集合等. 一.启动MongoDB并连接shell客户端 使用mongod.exe和mong ...
- 【mongodb系统学习之八】mongodb shell常用操作
八.mongodb shell常用基础操作(每个语句后可以加分号,也可以不加,看情况定(有的工具中可以不加),最好是加): 1).进入shell操作界面:mongo,上边已有演示: 2).查看当前使 ...
- 【mongodb系统学习之三】进入mongodb shell
三. 进入mongodb shell(数据库操作界面) : 1).在mongodb的bin目录下输入./mongo,默认连接test数据库,连接成功会显示数据库版本和当前连接的数据库名,如图: 2). ...
随机推荐
- Rails内存的问题 Java内存情况
Rails内存的问题 Java内存情况 一个txt文件,100M,300万行,都是坐标数据: 需要进行坐标的变换.计算.比较: 在Rails中使用Ruby进行计算,会导致内存超过1.5G,最后溢出而亡 ...
- 电脑显示U盘,可是读取不了
问题: 我的一个内存卡没用,放到了读卡器上.刚開始能用,可是到了后来,突然之间发现: 插入读卡器之后,仅仅是在U下角显示有有U盘提示,提示"打开设备和打印"或者"安全删除 ...
- 从QQ聊天看交流的有效性
首先让我们看一则约10分钟的QQ群聊天记录.截图例如以下.已经进行了隐私保护. 交流的主体为大二的在校生与刚刚毕业的学长之间的对话,学长參加过培训,在校学弟想了解一下.故有了以下的交流.(从上到下,从 ...
- Android生命周期里你也许不知道的事
Android生命周期预计连刚開始学习的人都再熟悉只是的东西了,但这里我抛出几个问题.也许大家曾经没有想过或者可能认识的有些错误. 一.当A启动B时,A和B生命周期方法运行的先后顺序是如何的?当按返回 ...
- 仿写从iOS8开始支持的UIAlertController:BGAAlertController-Android
工作以来公司UI设计师出的Android效果图都是iOS风格的UIAlertView和UIActionSheet,新项目还是用原来那一套,不想重复造轮子,所以仿写了从iOS8开始支持的UIAlertC ...
- zzulioj--1633--Happy Thanksgiving Day - Hateable Name(字符串筛选)
1633: Happy Thanksgiving Day - Hateable Name Time Limit: 1 Sec Memory Limit: 128 MB Submit: 75 ...
- WPF 基础
关于布局的规则 控件的布局应该由容器来决定,而不是通过自身使用margin之类的东西来控制位置 避免为控件定义明确的尺寸,但应该限定一个可接受的最大及最小尺寸 不要将界面元素设置成与屏幕坐标相关 容器 ...
- 阿里云ecs : Couldn't connect to host, port: smtp.aliyun.com, 25; timeout -1;
上传到服务器后javamail发邮件异常 链接 原来是ECS基于安全考虑,禁用了端口25. 改成465就可以发邮件了. p.setProperty("mail.smtp.socketFact ...
- 我的Java历程_Java对象类型的转换
向上转型: 可以将子类对象看作是父类对象叫做“向上转型”,由于向上转型是从一个较为具体的类向较为抽象的类的转换,所以它总是安全的. 例如:可以将正方形.长方形叫做是四边形,但是不能说四边形是正方形或长 ...
- 计算 List 数据的属性值的总和
List<PostRushPretreatmentMember> taskMember = pre.getTaskMember();///成员分配情况 Integer taskOrderN ...