top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the concept of capped collection and when exactly it is used ?

+3 votes
541 views
What is the concept of capped collection and when exactly it is used ?
posted Jun 15, 2015 by Neeraj Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Capped collection is one of the variant of collection in mongoDB. Capped collection is used to put limitation on maximum disk size in term of bytes. Even for a capped collection, limit can be put on max # of documents.
When max number of documents in a capped collection reaches, oldest document in capped collection is deleted automatically without executing any command explicitly.

Wherever fast insertion and reading the document is needed, capped collection is preferred.

answer Jun 17, 2015 by Alok
...