使用mongo shell和客户端连接至MongoDB Atlas
MongoDB Atlas是Mongo官方的一个集群服务,也可以注册并创建一个免费的集群,但DB的大小只有500M,如果数据量不是很大的应用,可以选择该集群方案
需要注意的是,目前我使用的这个集群,服务器存放在Amazon AWS上,这是一个外网的地址,所以需要有特别的方法才能可以连接到

首先在集群中创建用户名和密码,连接至集群时,需要用到

下载mongodb 3.6.4,下载以下安装包,https://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.6.4-signed.msi (该版本目前是最新的版本,新的版本包含更多的安全特性)
安装mongodb,安装的步骤,请参考《Windows 10 安装 Mongodb》

安装完成后,将mongodb的目录(我本机的C:\mongodb\bin)加入至环境变量中,这个动作是方便直接打开命令行工具就可以直接输入mogo能够直接打开mongo的客户端,而不需要进入至mongodb的安装目录中的bin目录才可以使用

mongod shell连接至集群中
获取连接字符串,点击集群中的“CONNECT”按钮,会弹出连接的方法,这里我们选择Mongo Shell的方式

选择了Mongo Shell后,会弹出连接的版本,因为我已经安装了最新的mongo版本(3.6.4),直接复制连接字符串至命令行

打开命令工具,输入命令,其中XXXXX的部分,即你集群的地址,可以在上面找到
mongo "mongodb+srv://XXXXXXXXXXXXX/test" --username weschen

输入了连接字符串后,可以查看到当前mongo客户端的版本,接着需要输入用户对应的密码

查询语句与原来的Mongodb命令一样

Studio 3T连接至集群
打开Studio 3T客户端

命令连接字符串
mongodb+srv://<授权的用户名>:<授权的用户密码>@<集群地址>/?connect=direct

点击OK后,会解析到集群用到的所有服务器,mongodb atlas默认是三台服务器

点击Test Connection,可以查看到是否已经正常连接到了,点击“Save”保存当前的连接

点击连接后,即可正常连接到集群

其他的操作与平时连接普通的DB没有什么不同
mongo connector for BI工具本地连接至mongo atlas
目前在本机已经安装了mongo connector for BI工具,关于mongodb connector for BI工具的安装步骤,可以参考《mongo connect BI 连接至Power BI》
查看文档,发现mongodb atlas M10以上的版本已经包含了mongo connector for BI,见https://docs.atlas.mongodb.com/bi-connection/?_ga=2.20605502.764772234.1523863254-688579200.1520828099#bi-connection
但因为我们目前是使用免费的版本,所以,还需要使用mongo connector for BI工具连接至mongo atlas中,但只能是本地连接,见https://docs.mongodb.com/bi-connector/current/#hosted-database-and-on-premises-bi-short
目前
使用mongo shell和客户端连接至MongoDB Atlas的更多相关文章
- MongoDB - Introduction of the mongo Shell
Introduction The mongo shell is an interactive JavaScript interface to MongoDB. You can use the mong ...
- MongoDB的基本操作:服务端启动,客户端连接,CRUD操作
本文内容: MongoDB的介绍 MongoDB服务端的启动 MongoDB客户端连接 SQL与MongoDB相关概念解释 什么是BSON 数据库操作 集合操作 文档操作 测试环境:win10 软件版 ...
- MongoDB - The mongo Shell, mongo Shell Quick Reference
mongo Shell Command History You can retrieve previous commands issued in the mongo shell with the up ...
- MongoDB - The mongo Shell, Data Types in the mongo Shell
MongoDB BSON provides support for additional data types than JSON. Drivers provide native support fo ...
- MongoDB - The mongo Shell, Write Scripts for the mongo Shell
You can write scripts for the mongo shell in JavaScript that manipulate data in MongoDB or perform a ...
- MongoDB - The mongo Shell, Access the mongo Shell Help
In addition to the documentation in the MongoDB Manual, the mongo shell provides some additional inf ...
- 20190418 CentOS7实用技能综合:系统安装 + WinScp客户端连接 + 防火墙端口号iptables + Nginx编译安装 + MySQL编译安装 + Redis编译安装 + MongoDB编译安装 + ActiveMQ/RocketMQ/RabbitMQ编译安装 + ...各类常用生产环境软件的编译安装
系统安装 + WinScp客户端连接 + 防火墙端口号iptables + Nginx编译安装 + MySQL编译安装 + Redis编译安装 + MongoDB编译安装 + ActiveMQ/Roc ...
- MongoDB - MongoDB CRUD Operations, Query Documents, Iterate a Cursor in the mongo Shell
The db.collection.find() method returns a cursor. To access the documents, you need to iterate the c ...
- MongoDB基本增删改查操作-mongo shell
基础 1.查看所有数据库: show dbs 2.选择数据库: use test 3.查看数据库中有哪些集合: show collections 如下图: 查询 1.查看集合中有哪些数据,其中abc为 ...
随机推荐
- 003.关于数组的操作 [growing]
1.获取数组的长度 #include<iostream> using namespace std; template<class T> int length(T& ar ...
- POJ 2976 二分
Dropping tests Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 12515 Accepted: 4387 D ...
- 第三方库升级Nginx
通过PPA方式,来升级Nginx 1. 添加PPA sudo add-apt-repository ppa:nginx/stable sudo apt-get updatesudo apt-get u ...
- MongoDB入门(7)- SpringDataMongoDB
入门 本文介绍如何应用SpringDataMongoDB操作实体和数据库,本文只介绍最基本的例子,复杂的例子在后面的文章中介绍. SpringDataMongoDB简介 SpringDataMongo ...
- 耗子学Python了(1)___Python环境配置
一:写在开始的开始 最近我们团对的老大问我想看什么书,我让老大买了一本<Python 3面向对象编程>,所以在看的时候边敲边实践,决定在自己电脑配置下相应的环境,然后开始Python的学习 ...
- Codeforces Round #380 (Div. 2)/729D Sea Battle 思维题
Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the ...
- 【BZOJ】3038: 上帝造题的七分钟2 && 3211: 花神游历各国
[算法]线段树||树状数组&&并查集 [题解]修改必须暴力单点修改,然后利用标记区间查询. 优化:一个数经过不断开方很快就会变成1,所以维护区间最大值. 修改时访问到的子树最大值< ...
- velocity & freemarker
一.Velocity Velocity是一个基于java的模板引擎(template engine).它允许任何人仅仅使用简单的模板语言(template language)来引用由java代码定义的 ...
- 10.异步SRAM的FPGA读写操作
异步SRAM:正如其名,不是与特定的时钟信号同步运行,而是根据输入信号的状态运行的.因为没有信号表明读取时已确定了有效数据,也没有信号表明写入时已接收到数据,所以,需要获取制造商的数据手册,根据时序图 ...
- python基础===多线程
https://www.cnblogs.com/wj-1314/p/8263328.html threading 模块 先上代码: import time, threading def loop(): ...