Articles → MONGODB → Capped Collection In Mongodb

Capped Collection In Mongodb






Purpose





Syntax


db.createCollection([collection_name], { capped: true, size: [size], max:[max documents] })



Create A Capped Collection




db.createCollection("myCappedCollection", { capped: true, size: 1024, max:2 })



Insert Values In The Capped Collection




Picture showing inserting 2 values in the capped collection




Picture showing inserting and overwriting the values in capped collection





Posted By  -  Karan Gupta
 
Posted On  -  Monday, June 24, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250