目录
本文导读
- 本文承接《 MongoDB 下载_安装_配置 及 启动与连接》、《 MongoDB 数据库_集合_文档 操作》
- 如同 Mysql 数据库一样,SQL 语句助于学习和理解,可实际开发中也没必要完全通过命令行进行 命令操作,所以有各种 Mysql 的可视化工具,同理 MongoDB 也有很多,这里介绍 简单方便绿色的 Robomongo
Robomongo 下载
- Robomongo 官网地址:https://robomongo.org/ ————选择右侧的 Robo 3T
- Robomongo 下载地址:https://robomongo.org/download
Robomongo 使用
- 先确保 MongoDB 数据库运行成功,可以参考《 MongoDB 下载_安装_配置 及 启动与连接》
- 如下所示 MongoDB 数据库启动成功,连接端口为 27017
-
C:\Users\Administrator.SC
-201707281232>mongod --dbpath=D:\MongoDB\Data
-
2018
-09
-11T16:
53:
27.512+
0800 I CONTROL [main] Automatically disabling TLS
1.0,
to force-enable TLS
1.0 specify --sslDisabledProtocols
'none'
-
2018
-09
-11T16:
53:
28.680+
0800 I CONTROL [initandlisten] MongoDB starting : pid=
18468 port=
27017 dbpath=D:\MongoDB\Data
64-bit host=SC
-201707281232
-
2018
-09
-11T16:
53:
28.680+
0800 I CONTROL [initandlisten] targetMinOS: Windows
7/Windows
Server
2008 R2
-
2018
-09
-11T16:
53:
28.681+
0800 I CONTROL [initandlisten] db version v4
.0
.2-rc0
-
2018
-09
-11T16:
53:
28.681+
0800 I CONTROL [initandlisten] git version: fc1573ba18aee42f97a3bb13b67af7d837826b47
-
2018
-09
-11T16:
53:
28.682+
0800 I CONTROL [initandlisten] allocator: tcmalloc
-
2018
-09
-11T16:
53:
28.682+
0800 I CONTROL [initandlisten] modules: none
-
2018
-09
-11T16:
53:
28.682+
0800 I CONTROL [initandlisten] build environment:
-
2018
-09
-11T16:
53:
28.682+
0800 I CONTROL [initandlisten] distmod:
2008plus-ssl
-
2018
-09
-11T16:
53:
28.683+
0800 I CONTROL [initandlisten] distarch: x86_64
-
2018
-09
-11T16:
53:
28.683+
0800 I CONTROL [initandlisten] target_arch: x86_64
-
2018
-09
-11T16:
53:
28.683+
0800 I CONTROL [initandlisten] options: { storage: { dbPath:
"D:\MongoDB\Data" } }
-
2018
-09
-11T16:
53:
28.728+
0800 I STORAGE [initandlisten] Detected data files
in D:\MongoDB\Data created by the
'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
-
2018
-09
-11T16:
53:
28.728+
0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=
3552M,session_max=
20000,eviction=(threads_min=
4,threads_max=
4),config_base=
false,statistics=(fast),
log=(enabled=
true,archive=
true,path=journal,compressor=snappy),file_manager=(close_idle_time=
100000),statistics_log=(wait=
0),verbose=(recovery_progress),
-
2018
-09
-11T16:
53:
29.241+
0800 I STORAGE [initandlisten] WiredTiger message [
1536656009:
241353][
18468:
140730388790352], txn-recover: Main recovery
loop: starting at
1/
456448
-
2018
-09
-11T16:
53:
29.372+
0800 I STORAGE [initandlisten] WiredTiger message [
1536656009:
372296][
18468:
140730388790352], txn-recover: Recovering
log
1 through
2
-
2018
-09
-11T16:
53:
29.497+
0800 I STORAGE [initandlisten] WiredTiger message [
1536656009:
496452][
18468:
140730388790352], txn-recover: Recovering
log
2 through
2
-
2018
-09
-11T16:
53:
29.571+
0800 I STORAGE [initandlisten] WiredTiger message [
1536656009:
571411][
18468:
140730388790352], txn-recover:
Set global recovery timestamp:
0
-
2018
-09
-11T16:
53:
29.939+
0800 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(
0,
0)
-
2018
-09
-11T16:
53:
30.639+
0800 I CONTROL [initandlisten]
-
2018
-09
-11T16:
53:
30.640+
0800 I CONTROL [initandlisten] ** WARNING: Access control
is
not enabled
for the database.
-
2018
-09
-11T16:
53:
30.642+
0800 I CONTROL [initandlisten] ** Read
and write access
to data
and configuration
is unrestricted.
-
2018
-09
-11T16:
53:
30.643+
0800 I CONTROL [initandlisten]
-
2018
-09
-11T16:
53:
30.647+
0800 I CONTROL [initandlisten] ** WARNING: This
server
is bound
to localhost.
-
2018
-09
-11T16:
53:
30.648+
0800 I CONTROL [initandlisten] ** Remote systems will be unable
to connect
to this
server.
-
2018
-09
-11T16:
53:
30.649+
0800 I CONTROL [initandlisten] ** Start the
server
with --bind_ip <address>
to specify which IP
-
2018
-09
-11T16:
53:
30.649+
0800 I CONTROL [initandlisten] ** addresses it should serve responses from,
or
with --bind_ip_all
to
-
2018
-09
-11T16:
53:
30.652+
0800 I CONTROL [initandlisten] ** bind
to all interfaces.
If this behavior
is desired, start the
-
2018
-09
-11T16:
53:
30.653+
0800 I CONTROL [initandlisten] **
server
with --bind_ip
127.0
.0
.1
to disable this warning.
-
2018
-09
-11T16:
53:
30.654+
0800 I CONTROL [initandlisten]
-
2018
-09
-11T16:
53:
32.894+
0800 I FTDC [initandlisten] Initializing full-
time diagnostic data capture
with directory
'D:/MongoDB/Data/diagnostic.data'
-
2018
-09
-11T16:
53:
32.896+
0800 I NETWORK [initandlisten] waiting
for connections
on port
27017
-
2018
-09
-11T16:
55:
12.398+
0800 I NETWORK [listener] connection accepted from
127.0
.0
.1:
10531 #
1 (
1 connection
now open)
-
2018
-09
-11T16:
55:
12.398+
0800 I NETWORK [conn1] received client metadata from
127.0
.0
.1:
10531 conn1: { application: { name:
"robo3t" }, driver: { name:
"MongoDB Internal Client", version:
"3.4.3-10-g865d2fb" }, os: { type:
"Windows", name:
"Microsoft Windows 8", architecture:
"x86_64", version:
"6.2 (build 9200)" } }
-
2018
-09
-11T16:
55:
12.452+
0800 I NETWORK [listener] connection accepted from
127.0
.0
.1:
10532 #
2 (
2 connections
now open)
-
2018
-09
-11T16:
55:
12.462+
0800 I NETWORK [conn2] received client metadata from
127.0
.0
.1:
10532 conn2: { application: { name:
"MongoDB Shell" }, driver: { name:
"MongoDB Internal Client", version:
"3.4.3-10-g865d2fb" }, os: { type:
"Windows", name:
"Microsoft Windows 8", architecture:
"x86_64", version:
"6.2 (build 9200)" } }
-
.......
- 如下所示 与 mongoDB 客户端 操作的结果是一样的,介绍至此!
-
> show dbs
-
admin
0.
000GB
-
config
0.
000GB
-
local
0.
000GB
-
mydb1
0.
000GB
-
>
use mydb1
-
switched to db mydb1
-
> show tables
-
c1
-
c2
-
c3
-
> db.c3.find()
-
{
"_id" : ObjectId(
"5b9760b79f148825ca955d13"),
"name" :
"zhangSan_cool",
"age" :
28,
"desc" :
"hello world" }
-
{
"_id" : ObjectId(
"5b9760c39f148825ca955d14"),
"name" :
"liSi",
"age" :
25,
"desc" :
"hello world" }
-
{
"_id" : ObjectId(
"5b9760cb9f148825ca955d15"),
"name" :
"wangWu",
"age" :
26,
"desc" :
"hello world" }
-
{
"_id" : ObjectId(
"5b9760d29f148825ca955d16"),
"name" :
"zhaoLiu",
"age" :
25,
"desc" :
"hello world" }
-
{
"_id" : ObjectId(
"5b9760e59f148825ca955d17"),
"name" :
"maQi",
"age" :
27,
"desc" :
"hello world" }
-
{
"_id" : ObjectId(
"5b976615c8ed70d9c9af79b7"),
"price" :
7000,
"desc" :
"hello world" }
-
>