Explain the concept of Capped Collections.

Updated May 1, 2026

Short answer

Capped collections are fixed-size collections that support high-throughput operations based on insertion order.

Deep explanation

Once the size limit is reached, MongoDB automatically makes room for new documents by overwriting the oldest ones (FIFO). They don't support deletions.

Real-world example

Storing system logs or recent activity feeds where only the latest data matters.

Common mistakes

  • Trying to delete a document from a capped collection (not allowed).

Follow-up questions

  • Can you change the size of a capped collection?

More MongoDB interview questions

View all →