我的编程空间,编程开发者的网络收藏夹
学习永远不晚

Mongodb详解与安装

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

Mongodb详解与安装

NOSQL的数据存储模型
键值模型:(key-avalue存储)
优点:查找速度快
缺点:数据无结构,通常只被当作字符串或二进制数据
应用场景:内容缓存
实例:Redis,Dynamo

列式模型
数据模型:数据按列存储,将同一列数据存在一起。
优点:查找迅速,可扩展性强,易于实现分布式
缺点:功能相对SQL很有限
应用场景:分布式文件系统或分布式存储
实例:Bigtable(google),Cassandra(facebook),HBase(hadoop),Hypertable

文档模型
数据模型:与键值模型类似,value指向结构化数据
优点:数据格式要求不严格,无需事先定义结构
缺点:查询性能不高,缺乏统一查询语法
应用场景:web应用
实例:MongoDB,CouchDB

图式模型
数据模型:图结构模型
优点:利用图结构相关算法提高性能,并满足特珠场景应用需求
缺点:难以实现分布式,功能有定向性
应用场景:社交网络,推荐系统,关系图谱
实例:Neo4j
ww.nosql.database.org

 

mongodb
C/S
 mongod
 mongo-->mongod
 mongo>use testdb(不需要分号;结尾)
 mongo>db.mycollection.insert()
 
 面向collection的数据库
  数据库:但数据库无须创建
  表:行<-->集合:文档
  集合无须事先定义;

 

 

安装与配置

1、 创建 /etc/yum.repos.d/mongodb-org-3.0.repo文件

 

[root@hadoop2 ~]# vim /etc/yum.repos.d/mongodb-org-3.0.repo

[mongodb-org-3.0]
name=MongoDB Repostitory
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1

 #[mongodb-org-2.6]
#name=MongoDB 2.6 Repository
#baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
#gpgcheck=0
#enabled=1
 

 

2、配置

[root@hadoop2 ~]# yum install -y mongodb-org

[root@hadoop2 ~]# mkdir -p /mongod/data

[root@hadoop2 ~]# chown -R mongod.mongod /mongo

[root@hadoop2 ~]# vim /etc/mongod.conf

# mongod.conf

#where to log
logpath=/var/log/mongodb/mongod.log

logappend=true

# fork and run in background
fork=true

#port=27017

dbpath=/mongo/data/                         ##改一下数据存放路径

# location of pidfile
pidfilepath=/var/run/mongodb/mongod.pid

 

[root@hadoop2 mongo]# service mongod start
Starting mongod:                                           [确定]

 

3、基础操作

[root@hadoop2 mongo]# mongo
MongoDB shell version: 3.0.4
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
 http://docs.mongodb.org/
Questions? Try the support group
 http://groups.google.com/group/mongodb-user
Server has startup warnings:
2015-07-21T14:58:55.518+0800 I CONTROL  [initandlisten]
2015-07-21T14:58:55.518+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-07-21T14:58:55.518+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-07-21T14:58:55.518+0800 I CONTROL  [initandlisten]
2015-07-21T14:58:55.519+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-07-21T14:58:55.519+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-07-21T14:58:55.519+0800 I CONTROL  [initandlisten]
2015-07-21T14:58:55.519+0800 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 1024 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
2015-07-21T14:58:55.519+0800 I CONTROL  [initandlisten]
> help
 db.help()                    help on db methods
 db.mycoll.help()             help on collection methods
 sh.help()                    sharding helpers
 rs.help()                    replica set helpers
 help admin                   administrative help
 help connect                 connecting to a db help
 help keys                    key shortcuts
 help misc                    misc things to know
 help mr                      mapreduce

 show dbs                     show database names
 show collections             show collections in current database
 show users                   show users in current database
 show profile                 show most recent system.profile entries with time >= 1ms
 show logs                    show the accessible logger names
 show log [name]              prints out the last segment of log in memory, 'global' is default
 use <db_name>                set current database
 db.foo.find()                list objects in collection foo
 db.foo.find( { a : 1 } )     list objects in foo where a == 1
 it                           result of the last line evaluated; use to further iterate
 DBQuery.shellBatchSize = x   set default number of items to display on shell
 exit                         quit the mongo shell
> show co
CountDownLatch         connect(               copyDbpath(
compare(               connectionURLTheSame(  copyFile(
compareOn(             constructor
> show dbs
local  0.078GB
> for(i=1;i<=100;i++) db.testcoll.insert({Name: "User"+i,Age: i,Gender: "M",PreferBook: ["first book","Second book"]})
WriteResult({ "nInserted" : 1 })
> db.testcoll.find()
{ "_id" : ObjectId("55adefd39883f07d0866c3b4"), "Name" : "User1", "Age" : 1, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b5"), "Name" : "User2", "Age" : 2, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b6"), "Name" : "User3", "Age" : 3, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b7"), "Name" : "User4", "Age" : 4, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b8"), "Name" : "User5", "Age" : 5, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b9"), "Name" : "User6", "Age" : 6, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ba"), "Name" : "User7", "Age" : 7, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bb"), "Name" : "User8", "Age" : 8, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bc"), "Name" : "User9", "Age" : 9, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bd"), "Name" : "User10", "Age" : 10, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3be"), "Name" : "User11", "Age" : 11, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bf"), "Name" : "User12", "Age" : 12, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c0"), "Name" : "User13", "Age" : 13, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c1"), "Name" : "User14", "Age" : 14, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c2"), "Name" : "User15", "Age" : 15, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c3"), "Name" : "User16", "Age" : 16, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c4"), "Name" : "User17", "Age" : 17, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c5"), "Name" : "User18", "Age" : 18, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c6"), "Name" : "User19", "Age" : 19, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c7"), "Name" : "User20", "Age" : 20, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
Type "it" for more
> it
{ "_id" : ObjectId("55adefd49883f07d0866c3c8"), "Name" : "User21", "Age" : 21, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c9"), "Name" : "User22", "Age" : 22, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ca"), "Name" : "User23", "Age" : 23, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3cb"), "Name" : "User24", "Age" : 24, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3cc"), "Name" : "User25", "Age" : 25, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3cd"), "Name" : "User26", "Age" : 26, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ce"), "Name" : "User27", "Age" : 27, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3cf"), "Name" : "User28", "Age" : 28, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d0"), "Name" : "User29", "Age" : 29, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d1"), "Name" : "User30", "Age" : 30, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d2"), "Name" : "User31", "Age" : 31, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d3"), "Name" : "User32", "Age" : 32, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d4"), "Name" : "User33", "Age" : 33, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d5"), "Name" : "User34", "Age" : 34, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d6"), "Name" : "User35", "Age" : 35, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d7"), "Name" : "User36", "Age" : 36, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d8"), "Name" : "User37", "Age" : 37, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3d9"), "Name" : "User38", "Age" : 38, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3da"), "Name" : "User39", "Age" : 39, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3db"), "Name" : "User40", "Age" : 40, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
Type "it" for more
> it
{ "_id" : ObjectId("55adefd49883f07d0866c3dc"), "Name" : "User41", "Age" : 41, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3dd"), "Name" : "User42", "Age" : 42, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3de"), "Name" : "User43", "Age" : 43, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3df"), "Name" : "User44", "Age" : 44, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e0"), "Name" : "User45", "Age" : 45, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e1"), "Name" : "User46", "Age" : 46, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e2"), "Name" : "User47", "Age" : 47, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e3"), "Name" : "User48", "Age" : 48, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e4"), "Name" : "User49", "Age" : 49, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e5"), "Name" : "User50", "Age" : 50, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e6"), "Name" : "User51", "Age" : 51, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e7"), "Name" : "User52", "Age" : 52, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e8"), "Name" : "User53", "Age" : 53, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3e9"), "Name" : "User54", "Age" : 54, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ea"), "Name" : "User55", "Age" : 55, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3eb"), "Name" : "User56", "Age" : 56, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ec"), "Name" : "User57", "Age" : 57, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ed"), "Name" : "User58", "Age" : 58, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ee"), "Name" : "User59", "Age" : 59, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ef"), "Name" : "User60", "Age" : 60, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
Type "it" for more
> db.testcoll.find().limit(2)
{ "_id" : ObjectId("55adefd39883f07d0866c3b4"), "Name" : "User1", "Age" : 1, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b5"), "Name" : "User2", "Age" : 2, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
> db.testcoll.remove({Age:10})
WriteResult({ "nRemoved" : 1 })
> db.testcoll.find().limit(15)
{ "_id" : ObjectId("55adefd39883f07d0866c3b4"), "Name" : "User1", "Age" : 1, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b5"), "Name" : "User2", "Age" : 2, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b6"), "Name" : "User3", "Age" : 3, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b7"), "Name" : "User4", "Age" : 4, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b8"), "Name" : "User5", "Age" : 5, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b9"), "Name" : "User6", "Age" : 6, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ba"), "Name" : "User7", "Age" : 7, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bb"), "Name" : "User8", "Age" : 8, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bc"), "Name" : "User9", "Age" : 9, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3be"), "Name" : "User11", "Age" : 11, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bf"), "Name" : "User12", "Age" : 12, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c0"), "Name" : "User13", "Age" : 13, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c1"), "Name" : "User14", "Age" : 14, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c2"), "Name" : "User15", "Age" : 15, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c3"), "Name" : "User16", "Age" : 16, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
> db.testcoll.re
db.testcoll.reIndex(           db.testcoll.renameCollection(
db.testcoll.remove(
> db.testcoll.remove({Name:"User14"})
WriteResult({ "nRemoved" : 1 })
> db.testcoll.find().limit(15)
{ "_id" : ObjectId("55adefd39883f07d0866c3b4"), "Name" : "User1", "Age" : 1, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b5"), "Name" : "User2", "Age" : 2, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b6"), "Name" : "User3", "Age" : 3, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b7"), "Name" : "User4", "Age" : 4, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b8"), "Name" : "User5", "Age" : 5, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b9"), "Name" : "User6", "Age" : 6, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ba"), "Name" : "User7", "Age" : 7, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bb"), "Name" : "User8", "Age" : 8, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bc"), "Name" : "User9", "Age" : 9, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3be"), "Name" : "User11", "Age" : 11, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bf"), "Name" : "User12", "Age" : 12, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c0"), "Name" : "User13", "Age" : 13, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c2"), "Name" : "User15", "Age" : 15, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c3"), "Name" : "User16", "Age" : 16, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c4"), "Name" : "User17", "Age" : 17, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
> db.testcoll.update({Name:"User12"},{$set:{Age: 32}})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.testcoll.find().limit(15)
{ "_id" : ObjectId("55adefd39883f07d0866c3b4"), "Name" : "User1", "Age" : 1, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b5"), "Name" : "User2", "Age" : 2, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b6"), "Name" : "User3", "Age" : 3, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b7"), "Name" : "User4", "Age" : 4, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b8"), "Name" : "User5", "Age" : 5, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b9"), "Name" : "User6", "Age" : 6, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ba"), "Name" : "User7", "Age" : 7, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bb"), "Name" : "User8", "Age" : 8, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bc"), "Name" : "User9", "Age" : 9, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3be"), "Name" : "User11", "Age" : 11, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bf"), "Name" : "User12", "Age" : 32, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c0"), "Name" : "User13", "Age" : 13, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c2"), "Name" : "User15", "Age" : 15, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c3"), "Name" : "User16", "Age" : 16, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c4"), "Name" : "User17", "Age" : 17, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
> db.testcoll.co
db.testcoll.constructor             db.testcoll.copyTo(
db.testcoll.convertToCapped(        db.testcoll.count(
db.testcoll.convertToSingleObject(
> db.testcoll.count()
98
> db.testcoll.find({Age: {$gte:93}})
{ "_id" : ObjectId("55adefd49883f07d0866c410"), "Name" : "User93", "Age" : 93, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c411"), "Name" : "User94", "Age" : 94, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c412"), "Name" : "User95", "Age" : 95, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c413"), "Name" : "User96", "Age" : 96, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c414"), "Name" : "User97", "Age" : 97, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c415"), "Name" : "User98", "Age" : 98, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c416"), "Name" : "User99", "Age" : 99, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c417"), "Name" : "User100", "Age" : 100, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
>
> db.testcoll.find({Age: {$gte:93}},{Name:1,Age:1})
{ "_id" : ObjectId("55adefd49883f07d0866c410"), "Name" : "User93", "Age" : 93 }
{ "_id" : ObjectId("55adefd49883f07d0866c411"), "Name" : "User94", "Age" : 94 }
{ "_id" : ObjectId("55adefd49883f07d0866c412"), "Name" : "User95", "Age" : 95 }
{ "_id" : ObjectId("55adefd49883f07d0866c413"), "Name" : "User96", "Age" : 96 }
{ "_id" : ObjectId("55adefd49883f07d0866c414"), "Name" : "User97", "Age" : 97 }
{ "_id" : ObjectId("55adefd49883f07d0866c415"), "Name" : "User98", "Age" : 98 }
{ "_id" : ObjectId("55adefd49883f07d0866c416"), "Name" : "User99", "Age" : 99 }
{ "_id" : ObjectId("55adefd49883f07d0866c417"), "Name" : "User100", "Age" : 100 }
> db.testcoll.find({$and: [{Age:{$gt: 61}},{Age: {$lt:80}}]})
{ "_id" : ObjectId("55adefd49883f07d0866c3f1"), "Name" : "User62", "Age" : 62, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3f2"), "Name" : "User63", "Age" : 63, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3f3"), "Name" : "User64", "Age" : 64, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3f4"), "Name" : "User65", "Age" : 65, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3f5"), "Name" : "User66", "Age" : 66, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3f6"), "Name" : "User67", "Age" : 67, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3f7"), "Name" : "User68", "Age" : 68, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3f8"), "Name" : "User69", "Age" : 69, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3f9"), "Name" : "User70", "Age" : 70, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3fa"), "Name" : "User71", "Age" : 71, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3fb"), "Name" : "User72", "Age" : 72, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3fc"), "Name" : "User73", "Age" : 73, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3fd"), "Name" : "User74", "Age" : 74, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3fe"), "Name" : "User75", "Age" : 75, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ff"), "Name" : "User76", "Age" : 76, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c400"), "Name" : "User77", "Age" : 77, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c401"), "Name" : "User78", "Age" : 78, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c402"), "Name" : "User79", "Age" : 79, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
> db.testcoll.insert({Name: "User101",Age: 101,Gender: "F",Address: "Beijing,Chian"})
WriteResult({ "nInserted" : 1 })
> db.testcoll.find({Address: {$exists: true}})
{ "_id" : ObjectId("55adf56044061abfb9ba93f2"), "Name" : "User101", "Age" : 101, "Gender" : "F", "Address" : "Beijing,Chian" }
> db.testcoll.find({Address: {$exists: false}})
{ "_id" : ObjectId("55adefd39883f07d0866c3b4"), "Name" : "User1", "Age" : 1, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b5"), "Name" : "User2", "Age" : 2, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b6"), "Name" : "User3", "Age" : 3, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b7"), "Name" : "User4", "Age" : 4, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b8"), "Name" : "User5", "Age" : 5, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3b9"), "Name" : "User6", "Age" : 6, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3ba"), "Name" : "User7", "Age" : 7, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bb"), "Name" : "User8", "Age" : 8, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bc"), "Name" : "User9", "Age" : 9, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3be"), "Name" : "User11", "Age" : 11, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3bf"), "Name" : "User12", "Age" : 32, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c0"), "Name" : "User13", "Age" : 13, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c2"), "Name" : "User15", "Age" : 15, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c3"), "Name" : "User16", "Age" : 16, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c4"), "Name" : "User17", "Age" : 17, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c5"), "Name" : "User18", "Age" : 18, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c6"), "Name" : "User19", "Age" : 19, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c7"), "Name" : "User20", "Age" : 20, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c8"), "Name" : "User21", "Age" : 21, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c3c9"), "Name" : "User22", "Age" : 22, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
Type "it" for more
> db.testcoll.update({Age: {$gt:80}},{$set: {Gender: "F"}})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 0 })
> db.testcoll.find({Age: {$gte: 80}})
{ "_id" : ObjectId("55adf56044061abfb9ba93f2"), "Name" : "User101", "Age" : 101, "Gender" : "F", "Address" : "Beijing,Chian" }
{ "_id" : ObjectId("55adefd49883f07d0866c403"), "Name" : "User80", "Age" : 80, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c404"), "Name" : "User81", "Age" : 81, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c405"), "Name" : "User82", "Age" : 82, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c406"), "Name" : "User83", "Age" : 83, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c407"), "Name" : "User84", "Age" : 84, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c408"), "Name" : "User85", "Age" : 85, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c409"), "Name" : "User86", "Age" : 86, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40a"), "Name" : "User87", "Age" : 87, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40b"), "Name" : "User88", "Age" : 88, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40c"), "Name" : "User89", "Age" : 89, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40d"), "Name" : "User90", "Age" : 90, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40e"), "Name" : "User91", "Age" : 91, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40f"), "Name" : "User92", "Age" : 92, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c410"), "Name" : "User93", "Age" : 93, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c411"), "Name" : "User94", "Age" : 94, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c412"), "Name" : "User95", "Age" : 95, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c413"), "Name" : "User96", "Age" : 96, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c414"), "Name" : "User97", "Age" : 97, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c415"), "Name" : "User98", "Age" : 98, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
Type "it" for more
> db.testcoll.update({Age: {$gt:85}},{$set: {Gender: "F"}},{multi:true})
WriteResult({ "nMatched" : 16, "nUpserted" : 0, "nModified" : 15 })
> db.testcoll.find({Age: {$gte: 80}})
{ "_id" : ObjectId("55adf56044061abfb9ba93f2"), "Name" : "User101", "Age" : 101, "Gender" : "F", "Address" : "Beijing,Chian" }
{ "_id" : ObjectId("55adefd49883f07d0866c403"), "Name" : "User80", "Age" : 80, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c404"), "Name" : "User81", "Age" : 81, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c405"), "Name" : "User82", "Age" : 82, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c406"), "Name" : "User83", "Age" : 83, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c407"), "Name" : "User84", "Age" : 84, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c408"), "Name" : "User85", "Age" : 85, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c409"), "Name" : "User86", "Age" : 86, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40a"), "Name" : "User87", "Age" : 87, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40b"), "Name" : "User88", "Age" : 88, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40c"), "Name" : "User89", "Age" : 89, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40d"), "Name" : "User90", "Age" : 90, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40e"), "Name" : "User91", "Age" : 91, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40f"), "Name" : "User92", "Age" : 92, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c410"), "Name" : "User93", "Age" : 93, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c411"), "Name" : "User94", "Age" : 94, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c412"), "Name" : "User95", "Age" : 95, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c413"), "Name" : "User96", "Age" : 96, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c414"), "Name" : "User97", "Age" : 97, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c415"), "Name" : "User98", "Age" : 98, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
Type "it" for more
> db.testcoll.update({Name: "User92"},{$unset:{PreferBooks: ""}})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 0 })
> db.testcoll.find({Age: {$gte: 80}})
{ "_id" : ObjectId("55adf56044061abfb9ba93f2"), "Name" : "User101", "Age" : 101, "Gender" : "F", "Address" : "Beijing,Chian" }
{ "_id" : ObjectId("55adefd49883f07d0866c403"), "Name" : "User80", "Age" : 80, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c404"), "Name" : "User81", "Age" : 81, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c405"), "Name" : "User82", "Age" : 82, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c406"), "Name" : "User83", "Age" : 83, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c407"), "Name" : "User84", "Age" : 84, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c408"), "Name" : "User85", "Age" : 85, "Gender" : "M", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c409"), "Name" : "User86", "Age" : 86, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40a"), "Name" : "User87", "Age" : 87, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40b"), "Name" : "User88", "Age" : 88, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40c"), "Name" : "User89", "Age" : 89, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40d"), "Name" : "User90", "Age" : 90, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40e"), "Name" : "User91", "Age" : 91, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c40f"), "Name" : "User92", "Age" : 92, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c410"), "Name" : "User93", "Age" : 93, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c411"), "Name" : "User94", "Age" : 94, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c412"), "Name" : "User95", "Age" : 95, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c413"), "Name" : "User96", "Age" : 96, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c414"), "Name" : "User97", "Age" : 97, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
{ "_id" : ObjectId("55adefd49883f07d0866c415"), "Name" : "User98", "Age" : 98, "Gender" : "F", "PreferBook" : [ "first book", "Second book" ] }
Type "it" for more

 

 

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

Mongodb详解与安装

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

Windows安装与配置—MongoDB

1,下载安装  打开下载链接:http://dl.mongodb.org/dl/win32/x86_64,选择后缀是2008plus-ssl-3.6.15.zip的版本,32位和64位通用。2,安装配置  第一步:解压到一个盘上,例如我的解压的目录D:Mong
Windows安装与配置—MongoDB
2017-11-12

MongoDB安装与Spring整合

MongoDB是面向文档的非关系型数据库,数据模型是一种类似于JSON的结构,在数据库中存的是各种各样的JSON。官网下载地址:https://www.mongodb.com/download-center/enterprise  一、以Centos为例,安装
MongoDB安装与Spring整合
2021-09-03

详解linux 使用docker安装mongodb方法

1、xshell远程到一台安装了docker和docker-conpose的服务器(安装方法见其他学习文件) 2、到home目录下新建Mongotest文件夹,进入这个文件夹,执行vi docker-compose.yml,插入如下内容,退
2022-06-03

docker安装mongoDB及使用方法详解

目录一、MongoDB是什么?1. mongo的体系结构2. mongoDB的特点(或使用场景)3. mongoDB与mysql、Redis对比4. mongoDB存储原理二、使用docker安装mongo1.安装2.创建用户3. 连接、测
2023-03-19

MongoDB介绍与安装(Windows版)

MongoDb是由C++语言编写的,是一个基于分布式文件存储的开源数据库系统。在高负载的情况下,添加更多的节点,可以保证服务器性能。MongoDB指在为web应用提供可扩展的高性能数据存储解决方案。MongoDB将数据存储为一个文档,数据结构由键值(key=>
MongoDB介绍与安装(Windows版)
2021-11-02

MongoDB卸载安装的详细安装教程

目录01 卸载1、 sc stop MongoDB2、 sc delete MongoDB3、 然后再是软件卸载,数据库删除02 MongoDB安装02::01 MongoDB安装js1、安装02::02 配置MongDB1、配置环境变量2
2023-04-14

Nacos下载与安装详解

目录 一、安装与下载二、数据持久化三、docker当中安装nacos 一、安装与下载 下载地址:https://github.com/alibaba/nacos/releases 我这里下载的windows版本的,不需要安
2023-08-17

Nginx安装与配置详解

Nginx负载均衡集群 一、Nginx简介1、nginx介绍2、反向代理2.1 什么是代理服务器?2.2 为什么要使用代理服务器?2.3 反向代理 VS 正向代理 3、负载均衡3.1 什么是负载均衡? 二、Nginx
2023-08-21

GNS3安装与使用详解

一、GNS3的安装以及配置      安装的路径很重要,如果不是按照默认路径安装的话,安装完要到编辑下的首选项里修改几个东西的路径。这对于我们新手比较麻烦,所以建议新手按照默认路径安装咯。然后如果360安全卫士有提示,全部选择“允许”。在这
2023-01-31

详解Keepalived安装与配置

一、简介 Keepalived是一个免费开源的,用C编写的类似于layer3, 4 & 7交换机制软件,具备我们平时说的第3层、第4层和第7层交换机的功能。主要提供loadbalancing(负载均衡)和 high-availability
2022-06-04

详解:Flannel安装与配置

Flannel是 CoreOS 团队针对 Kubernetes 设计的一个覆盖网络(Overlay Network)工具,其目的在于帮助每一个使用 Kuberentes 的 CoreOS 主机拥有一个完整的子网。简介
2023-06-05

编程热搜

目录