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). ...
随机推荐
- Redis windows版本的启停bat脚本命令
Reids windows版本安装 redis windows官网推荐:https://github.com/MicrosoftArchive/redis/releases 下载解压即可. 启停bat ...
- Maven导入ojdbc14.jar和ojdbc6.jar
Maven导入ojdbc14.jar和ojdbc6.jar 学习了:http://blog.csdn.net/johon_medison/article/details/51689690 在 ‘运行’ ...
- Android性能优化之ListView缓存机制
要想优化ListView首先要了解它的工作原理,列表的显示须要三个元素:ListView.Adapter.显示的数据. 这里的Adapter就是用到了适配器模式,无论传入的是什么View在ListVi ...
- cocos2d-x:读取指定文件夹下的文件名称+解决中文乱码(win32下有效)
援引:http://blog.csdn.net/zhanghefu/article/details/21284323 http://blog.csdn.net/cxf7394373/article/d ...
- Linux网络编程(3)——多进程、多线程
在我的里面已经介绍了linux以下c的进程.线程接口,这里就不做过多阐述了. 多进程 这里多进程採用传统的多进程模型.每当有client发来的连接时创建一个进程来处理连接,一个子进程相应一个连接. 有 ...
- 上传文件 nginx 413错误
nginx : 413 Request Entity Too Large 上传文件过程发生413 Request Entity Too Large错误,翻译为请求实体过大,断定为nginx限制了请求体 ...
- oracle 下操作blob字段是否会产生大量redo
操作blob字段是否会产生大量redo,答案是不会.以下来做一个实验,測试数据库版本号是11.2.0.1.0: --创建一张表做測试之用 create table test_blob ( id n ...
- ES设置查询的相似度算法
similarity Elasticsearch allows you to configure a scoring algorithm or similarity per field. The si ...
- [LeetCode] Longest Substring Without Repeating Characters 最长无重复字符的子串 C++实现java实现
最长无重复字符的子串 Given a string, find the length of the longest substring without repeating characters. Ex ...
- Chrome浏览器查看SSL证书信息
1.https使用f12打开,选中security 如果F12打不开,可以通过最右端的自定义及控制chrome菜单,打开"更多工具"-->"开发者工具" ...