-
一、數(shù)據(jù)更新
1、db.imooc_collection.find({x:1})
2、db.imooc_collection.update({x:1},{x:999})
3、db.imooc_collection.insert({x:100,y:100,z:100})
4、db.imooc_collection.update({z:100},{$set:{y:99}})
set操作符為部分更新操作符,使用set后,命令中存在的字段會(huì)被更新,不存在則會(huì)保持原樣
查看全部 -
一、數(shù)據(jù)庫寫入、查詢
1、./bin/mongo 127.0.0.1:12345
2、show dbs
3、use imooc
4、db.dropDatabase()
5、show dbs
6、use imooc
7、db.imooc_collection.insert({x: 1})
8、show dbs
9、show collections
10、db.imooc-collection.find()
11、db.imooc_collection.insert({x:2, _id: 1})
12、db.imooc_collection.find({x:1})
13、for(i=3;i<100;i++)db.imooc_collection.insert({x:i})
14、db.imooc_collection.find().count()
15、db.imooc_collection.find().skip(3).limit(2).sort({x:1})
skip過濾前3條數(shù)據(jù)
limit限制返回的條數(shù)為2條,
sort使用x排序
查看全部 -
一、搭建服務(wù)器
1、mkdir mongodb_simple
2、cd mongodb_simple/
3、mkdir data
4、mkdir log
5、mkdir conf
6、mkdir bin?
7、cp ../mongo-r2.6.5/ mongod bin/
8、cd conf/
9、vim mongod.conf
10、文件中添加
port = 12345
dbpath = data
logpath = log/mongod.log
fork = true
:wq保存
9、cd ..
10、ls
11、./bin/mongod -f conf/mongod.conf
12、cd data
13、ls
14、cd log/
15、tail mongod.log
查看全部 -
一、編譯
1、cd mongo-r2.6.5
2、scons all -j, 可以加速編譯過程,需要先安裝python,scons是用python編寫的。
二、ls
1、mongod是mongoDB數(shù)據(jù)庫的執(zhí)行程序。
2、mongorestore,導(dǎo)入導(dǎo)出二進(jìn)制數(shù)據(jù),不能被直接讀取,一般用來做數(shù)據(jù)的備份與恢復(fù)。
3、mongostat,mongoDB的各種狀態(tài)。
查看全部 -
一、索引支持
1、redis:key-value,速度很快,靈活性不高。
2、hbase:單索引,二級(jí)索引需要自己實(shí)現(xiàn)。寫入很快。
3、mongodb:單鍵索引,多鍵索引,數(shù)組索引,全文索引,地理位置索引
二、冗余擴(kuò)展
1、復(fù)制集保證數(shù)據(jù)安全。
2、分片擴(kuò)展數(shù)據(jù)規(guī)模。
查看全部 -
一、數(shù)據(jù)庫作用:
1、有組織地存放數(shù)據(jù)。
2、按照不同的需求進(jìn)行查詢。
查看全部 -
一、重要網(wǎng)站:
1、mongoDB官網(wǎng):www.mongodb.org。(1)安裝包下載。(2)使用文檔
2、mongoDB國內(nèi)官網(wǎng):www.monging.com
3、mongoDB中文翻譯:http://docs.mongoing.com/manual-zh/
4、mongoDB的github:https://github.com/mongodb?(1)源碼下載。
5、mongoDB的jira:https://jira.mongodb.org/browse/TOOLS-352?jql-? (1)bug提交及回復(fù)
6、兩個(gè)google groups:monogodb.user和mongodb.cn。(1)用戶交流
查看全部 -
二、數(shù)據(jù)庫故障:
1、單節(jié)點(diǎn)失效,如何恢復(fù)工作。
2、數(shù)據(jù)庫意外被殺死,如何進(jìn)行數(shù)據(jù)恢復(fù)。
3、數(shù)據(jù)庫發(fā)生拒絕服務(wù)時(shí)如何排查原因。
4、數(shù)據(jù)庫磁盤快滿時(shí)如何處理。
查看全部 -
一、mongoDB概念
查看全部 -
一、mongoDB是開源的Nosql數(shù)據(jù)庫:免費(fèi)、開源、良好的技術(shù)支持。
國外:ebay、github、sf(sourcefarge)
國內(nèi):淘寶、京東、360、大眾點(diǎn)評(píng)、天天動(dòng)聽、百度
二、LAMP: linux, apache, mysql, php
查看全部 -
?numactl?--interleave=all?mongod?-f?/etc/mongod.conf??? ??#分配所有的node供mongodb使用
查看全部 -
2? ? ?3
查看全部 -
學(xué)習(xí)階段-內(nèi)容
查看全部 -
為什么是mongodb
查看全部 -
為什么選擇mongodb
查看全部
舉報(bào)