Mongodb
2016-03-28 17:50
519 查看
http://www.mongodb.org/
https://docs.mongodb.org/v3.0/
http://docs.mongodb.org/getting-started/shell/
Why Nosql?
http://www.couchbase.com/nosql-resources/what-is-no-sql
https://www.mongodb.com/nosql-explained
http://wiki.jikexueyuan.com/project/mongodb/
第一天
Install MongoDB and basic operation
http://www.cnblogs.com/huangxincheng/archive/2012/02/18/2356595.html
32bit的mongodb最大只能存放2G的数据,64bit就没有限制。
mongodb中有三元素:数据库,集合,文档,其中“集合”就是对应关系数据库中的“表”,“文档”对应“行”。
启动mongodb:
C:\Program Files\MongoDB\Server\3.0\bin>mongod –dbpath=D:\mongoDB\db01
–httpinterface | nohttpinterface
MongoDB disables the HTTP interface by default.
http://docs.mongodb.org/manual/reference/program/mongod/#cmdoption–httpinterface
mongodb client shell
mongo
第二天
CRUD Details
http://www.cnblogs.com/huangxincheng/archive/2012/02/19/2357846.html
CRUD
insert() | find() |update()| remove()
Query selection operator
https://docs.mongodb.org/v3.0/reference/operator/query/#query-selectors
What are indexs in the db and usage?
Some shell commands:
db.getCollectionNames();
show collections
show dbs
db
use dbname
show tables
第三天
聚合 and 游标
http://www.cnblogs.com/huangxincheng/archive/2012/02/21/2361205.html
db.person.count()
db.person.count({“city”:”sh”})
db.person.distinct(“city”)
db.person.group()
http://blog.csdn.net/h70614959/article/details/7780227
https://docs.mongodb.org/manual/reference/command/group/
mapReduce in mongodb
http://www.mongovue.com/2011/04/05/how-to-perform-mapreduce-operations-in-mongovue-a-step-by-step-guide/
http://www.mongovue.com/2010/11/03/yet-another-mongodb-map-reduce-tutorial/
http://blog.csdn.net/zzq900503/article/details/8510030
What is map reduce?
http://www.csdn.net/article/2013-01-07/2813477-confused-about-mapreduce
http://ayende.com/blog/4435/map-reduce-a-visual-explanation
https://docs.mongodb.org/manual/reference/command/mapReduce/#mapreduce-map-cmd
http://www.open-open.com/lib/view/open1329455491750.html
聚合函数
http://www.infoq.com/cn/articles/implementing-aggregation-functions-in-mongodb
为什么要创建view database?
启动mongodb遇到如下异常:
exception in initAndListen: 12596 old lock file, terminating
解决方法
1.删除data目录中的.lock文件
2.mongod.exe –repair
3.启动mongod就可以了
第四天
索引
http://www.cnblogs.com/huangxincheng/archive/2012/02/29/2372699.html
db.collection.find().explain()
cursor.explain()
db.person.find({“name”:”hxc”+10000}).explain(‘allPlansExecution’)
Collection Scan
db.person.ensureIndex({“name”:1})
db.person.find({“name”: “hxc”+10000}).explain(“executionStats”)
唯一索引
组合索引
db.person.getIndexes()
db.person.dropIndexes(“name_1”)
索引会降低CUD这三种操作的性能,因为这玩意需要实时维护,所以啥问题都要综合考虑一下。
Mongodb主要内容:
1.Index
https://docs.mongodb.org/v3.0/indexes/
https://docs.mongodb.org/v3.0/
http://docs.mongodb.org/getting-started/shell/
Why Nosql?
http://www.couchbase.com/nosql-resources/what-is-no-sql
https://www.mongodb.com/nosql-explained
http://wiki.jikexueyuan.com/project/mongodb/
第一天
Install MongoDB and basic operation
http://www.cnblogs.com/huangxincheng/archive/2012/02/18/2356595.html
32bit的mongodb最大只能存放2G的数据,64bit就没有限制。
mongodb中有三元素:数据库,集合,文档,其中“集合”就是对应关系数据库中的“表”,“文档”对应“行”。
启动mongodb:
C:\Program Files\MongoDB\Server\3.0\bin>mongod –dbpath=D:\mongoDB\db01
–httpinterface | nohttpinterface
MongoDB disables the HTTP interface by default.
http://docs.mongodb.org/manual/reference/program/mongod/#cmdoption–httpinterface
mongodb client shell
mongo
第二天
CRUD Details
http://www.cnblogs.com/huangxincheng/archive/2012/02/19/2357846.html
CRUD
insert() | find() |update()| remove()
Query selection operator
https://docs.mongodb.org/v3.0/reference/operator/query/#query-selectors
What are indexs in the db and usage?
Some shell commands:
db.getCollectionNames();
show collections
show dbs
db
use dbname
show tables
第三天
聚合 and 游标
http://www.cnblogs.com/huangxincheng/archive/2012/02/21/2361205.html
db.person.count()
db.person.count({“city”:”sh”})
db.person.distinct(“city”)
db.person.group()
http://blog.csdn.net/h70614959/article/details/7780227
https://docs.mongodb.org/manual/reference/command/group/
mapReduce in mongodb
http://www.mongovue.com/2011/04/05/how-to-perform-mapreduce-operations-in-mongovue-a-step-by-step-guide/
http://www.mongovue.com/2010/11/03/yet-another-mongodb-map-reduce-tutorial/
http://blog.csdn.net/zzq900503/article/details/8510030
What is map reduce?
http://www.csdn.net/article/2013-01-07/2813477-confused-about-mapreduce
http://ayende.com/blog/4435/map-reduce-a-visual-explanation
https://docs.mongodb.org/manual/reference/command/mapReduce/#mapreduce-map-cmd
http://www.open-open.com/lib/view/open1329455491750.html
聚合函数
http://www.infoq.com/cn/articles/implementing-aggregation-functions-in-mongodb
为什么要创建view database?
启动mongodb遇到如下异常:
exception in initAndListen: 12596 old lock file, terminating
解决方法
1.删除data目录中的.lock文件
2.mongod.exe –repair
3.启动mongod就可以了
第四天
索引
http://www.cnblogs.com/huangxincheng/archive/2012/02/29/2372699.html
db.collection.find().explain()
cursor.explain()
db.person.find({“name”:”hxc”+10000}).explain(‘allPlansExecution’)
Collection Scan
db.person.ensureIndex({“name”:1})
db.person.find({“name”: “hxc”+10000}).explain(“executionStats”)
唯一索引
组合索引
db.person.getIndexes()
db.person.dropIndexes(“name_1”)
索引会降低CUD这三种操作的性能,因为这玩意需要实时维护,所以啥问题都要综合考虑一下。
Mongodb主要内容:
1.Index
https://docs.mongodb.org/v3.0/indexes/
相关文章推荐
- 分享微信开发Html5轻游戏中的几个坑
- 如何在 Fedora 上安装 MongoDB 服务器
- PHP添加yaf xhprof mongodb 同理
- mongodb安装
- 如何在 Ubuntu 上安装 MongoDB
- 信息安全聚合 Sec-News 的重构之路
- perl操作MongoDB报错undefined symbol: HeUTF8解决方法
- C#中使用1.7版本驱动操作MongoDB简单例子
- 使用zabbix监控mongodb的方法
- Node.js的MongoDB驱动Mongoose基本使用教程
- MongoDB系列教程(四):设置用户访问权限
- php实现的mongodb操作类实例
- 解决mongodb在ubuntu下启动失败,提示couldn‘t remove fs lock errno:9 Bad file descriptor的错误
- 在PostgreSQL的基础上创建一个MongoDB的副本的教程
- 关于mongoose连接mongodb重复访问报错的解决办法
- java操作mongodb示例分享
- php对mongodb的扩展(初出茅庐)
- 作为PHP程序员应该了解MongoDB的五件事
- 基于MySQL到MongoDB简易对照表的详解
- MongoDB入门教程之C#驱动操作实例