-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
ALL
-
Sharding 2018-03-26, Sharding 2018-04-09, Sharding 2018-05-07
Shell repro on master :
mongos> db.version() 3.7.1-340-gf2e1688 MongoDB Enterprise > db.runCommand({create : "cappedColl", capped : true}) { "ok" : 1, "$clusterTime" : { "clusterTime" : Timestamp(1518546909, 1), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } }, "operationTime" : Timestamp(1518546901, 2) } MongoDB Enterprise > db.getCollectionInfos() [ { "name" : "cappedColl", "type" : "collection", "options" : { "capped" : true, "size" : 0 }, "info" : { "readOnly" : false, "uuid" : UUID("ec90615e-a802-4529-a83f-e1e8163503a6") }, "idIndex" : { "v" : 2, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "JavaDriverTest.cappedColl" } } ]
The current behavior in 3.6 (and the behavior of replica sets on master), is that creating a capped collection without a size specified is an error:
MongoDB Enterprise > db.runCommand({create : "cappedColl", capped : true}) { "ok" : 0, "errmsg" : "specify size:<n> when capped is true", "code" : 14832, "codeName" : "Location14832" }