 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the MongoDB Capped Collection maximum allowable size?
It is up to you how much space you want. You need to use the parameter size to set. Use below syntax −
db.createCollection(‘yourCollectionName’, capped=true, size=yourValue);
Let us implement the above syntax in order to allow size for a capped collection −
> db.createCollection('cappedCollectionMaximumSize', capped=true, size=1948475757574646); { "ok" : 1 } Let us check the description of the above collection −
> db.cappedCollectionMaximumSize.find().explain();
This will produce the following output −
{    "queryPlanner" : {       "plannerVersion" : 1,       "namespace" : "test.cappedCollectionMaximumSize",       "indexFilterSet" : false,       "parsedQuery" : {       },       "winningPlan" : {          "stage" : "COLLSCAN",          "direction" : "forward"       },       "rejectedPlans" : [ ]    },    "serverInfo" : {       "host" : "DESKTOP-QN2RB3H",       "port" : 27017,       "version" : "4.0.5",       "gitVersion" : "3739429dd92b92d1b0ab120911a23d50bf03c412"    },    "ok" : 1 }Advertisements
 