Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
3.2.6
-
None
-
ALL
-
Description
Background
Different drivers may have different way to encode a integer to BSON, eg: when insert a document
{status: 1}
* mongoshell encode 1 to a 8bytes data, server received a request {status: 1.0}.
|
* nodejs driver encode 1 to 4bytes data, server received a request {status: 1}
|
|
MongoDB 3.2 behaivor
MongoDB-3.2 added on a new condition check when update a capped collection, this is suitable for all storage engines. Which means user "Cannot change the size of a document in a capped collection".
db/catalog/collection.cpp:556
|
const auto oldSize = oldDoc.value().objsize();
|
if (_recordStore->isCapped() && oldSize != newDoc.objsize())
|
return {ErrorCodes::CannotGrowDocumentInCappedNamespace,
|
str::stream() << "Cannot change the size of a document in a capped collection: "
|
<< oldSize << " != " << newDoc.objsize()};
|
MongoDB 3.0 behaivor
In mongodb 3.0, only mmapv1 have limitation to update a capped collection, that is "objects in a capped ns cannot grow(no need have the same size with old document".
|
|
if (isCapped())
|
return StatusWith<RecordId>(
|
ErrorCodes::InternalError, "failing update: objects in a capped ns cannot grow", 10003);
|
Attachments
Issue Links
- duplicates
-
SERVER-20529 WiredTiger allows capped collection objects to grow
-
- Closed
-