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). ...
随机推荐
- 一步一步跟我学习hadoop(7)----hadoop连接mysql数据库运行数据读写数据库操作
为了方便 MapReduce 直接訪问关系型数据库(Mysql,Oracle).Hadoop提供了DBInputFormat和DBOutputFormat两个类.通过DBInputFormat ...
- poj3101--Astronomy(分数的最小公倍数)
题目链接:id=3101">点击打开链接 题目大意:有n个行星,给出每个行星的旋转的周期.问最少多少时间后n个行星会在一条直线上,初始点在一起,不存在全部的行星都有同一个周期 如果A行 ...
- android 推断手机是否支持前置摄像头
话不多说 直接上代码, @SuppressLint("NewApi") public static boolean isSupportFrontCamera() { if (!ha ...
- NHibernate3剖析:Query篇之NHibernate.Linq增强查询
系列引入 NHibernate3.0剖析系列分别从Configuration篇.Mapping篇.Query篇.Session策略篇.应用篇等方面全面揭示NHibernate3.0新特性和应用及其各种 ...
- PHP第八课 字符串拆分经常使用函数
课程概要: 通过这节课可以对字符串进行主要的操作. 字符串知识点: 1.字符串的处理介绍 2.经常使用的字符串输出函数 3.经常使用的字符串格式化函数 4.字符串比較函数 5.正則表達式在字符串中的应 ...
- cocos2d-x_AnchorPoint锚点
锚点是定位和变换操作的一个重点.锚点我们能够看成用一根图钉将一张纸或者相片钉在墙上的那个点. 节点的位置是由我们设置的position和anchor point一起决定的. 值得一提的是,anchor ...
- 文档相关命令-cat命令查看一个文件
用于查看一个文件的内容并将其显示在屏幕上 cat 后直接加上文件名 -n 表示显示行号 cat -n dirb/filee -A 显示所有内容包括特殊字符 cat -A dirb/filee
- 用pigz来加速解压tar.gz
兼容tar.gz 多线程的解压工具, 用于解压大文件时使用. https://zlib.net/pigz/ 方法: 1. 安装pigz 2. 使用tar时,选择pigz tar --use-compr ...
- xBIM 基础01 简介
系列目录 [已更新最新开发文章,点击查看详细] 一.xBIM 简介 BIM(Building Information Modelling)建筑信息模型,xBIM(eXtensible Buil ...
- Ubuntu16.04下Mongodb官网卸载部署步骤(图文详解)(博主推荐)
不多说,直接上干货! 前期博客 Ubuntu16.04下Mongodb官网安装部署步骤(图文详解)(博主推荐) https://docs.mongodb.com/manual/tutorial/ins ...