db.events.update(
{upload:0},
{$set:{upload:1}},
{multi:true}
)
I am getting the following error even though I am just replacing an integer with another integer.
Cannot change the size of a document in a capped collection: 402 != 406
db.events.update(
{upload:0},
{$set:{upload:1}},
{multi:true}
)
I am getting the following error even though I am just replacing an integer with another integer.
Cannot change the size of a document in a capped collection: 402 != 406
it looks like you're inserting a
double
instead of anint32
(double
is 4 byte wider thanint32
).from mongodb type documentation :
To fix this issue, simply change your code to this :