【发布时间】:2017-05-11 17:03:10
【问题描述】:
db.events.update(
{upload:0},
{$set:{upload:1}},
{multi:true}
)
即使我只是用另一个整数替换一个整数,我也会收到以下错误。
Cannot change the size of a document in a capped collection: 402 != 406
【问题讨论】:
-
您确定没有将整数值
{upload:0}更新为双值{upload:1}吗?您可以通过运行db.events.find({upload: {$type: 'int'}})来检查类型,并查看它是否返回任何文档以供验证。您是否在 shell 中运行查询?
标签: mongodb capped-collections