Description
It should not be possible for a document to grow in size inside a capped collection. If usePowerOf2Sizes is set to true then documents can grow inside a Capped Collection
// Can grow the document with usePowerOf2Sizes
|
db.qwerty.drop()
|
db.createCollection("qwerty", {capped:true, size:100000})
|
db.runCommand( {collMod: "qwerty", usePowerOf2Sizes : true })
|
db.qwerty.insert({"test":"onetwothreefourfive", "foo" : "bar"})
|
db.qwerty.insert({"test":"fivesixseveneight", "foo" : "bar"})
|
db.qwerty.update({"test":"onetwothreefourfive", "foo" : "bar"}, {"test":"onetwothreefourfive", "foo" : "bar", "qwerty":"dvorak"})
|
db.qwerty.find()
|
|
// Can't grow the document without usePowerOf2Sizes
|
db.qwerty.drop()
|
db.createCollection("qwerty", {capped:true, size:100000})
|
db.qwerty.insert({"test":"onetwothreefourfive", "foo" : "bar"})
|
db.qwerty.insert({"test":"fivesixseveneight", "foo" : "bar"})
|
db.qwerty.update({"test":"onetwothreefourfive", "foo" : "bar"}, {"test":"onetwothreefourfive", "foo" : "bar", "qwerty":"dvorak"})
|
db.qwerty.find()
|