Capped Collection
目录
Overview
Create Capped Collection
# 创建的语法: db.createCollection(<name>, options)
> use testdb
switched to db testdb
# 创建时必须指定大小
> db.createCollection('testdb.mycoll', {capped:true})
{
"ok" : 0,
"errmsg" : "specify size:<n> when capped is true",
"code" : 14832,
"codeName" : "Location14832"
}
# 创建一个大小为5242880bytes, 文档数为5000的collection
> db.createCollection('mycoll', {capped : true, size : 5242880, max : 5000})
{ "ok" : 1 }
> show collections
mycollRestrictions and Recommendations
更新操作
文档大小
文档删除
分片
有效查询
聚合操作的$out
Procedures
创建Capped Collection
查询Capped Collection
判断是否为Capped Collection
将普通集合转化为Capped Collection
设置数据过期清理
Tailable Cursor
Last updated