MongoDB Documentation, Release 3.0.4 can disable the power of 2 allocation (page 91) using the collMod command with the noPadding flag or the db.createCollection() method with the noPadding option. Prior to version 3.0.0, MongoDB used an allocation strategy that included a dynamically calculated padding as a factor of the document size. Capped collections are fixed-size collections that support high-throughput operations that store records in insertion order. Capped collections work like circular buffers: once a collection fills its allocated space, it makes room for new documents by overwriting the oldest documents in the collection. See Capped Collections (page 209) for more information. The following tutorials provide instructions for querying and modifying data. For a higher-level overview of these operations, see MongoDB CRUD Operations (page 57). In MongoDB, the db.collection.insert() method adds new documents into a collection. 3.3.1 Insert Documents 3.3 MongoDB CRUD Tutorials Capped Collections Insert Documents (page 92) Insert new documents into a collection. Query Documents (page 96) Find documents in a collection using search criteria. Modify Documents (page 102) Modify documents in a collection Remove Documents (page 106) Remove documents from a collection. Limit Fields to Return from a Query (page 107) Limit which fields are returned by a query. Limit Number of Elements in an Array after an Update (page 109) Use $push with modifiers to sort and maintain an array of fixed size. Iterate a Cursor in the mongo Shell (page 110) Access documents returned by a find query by iterating the cursor, either manually or using the iterator index. Analyze Query Performance (page 111) Use query introspection (i.e. explain ) to analyze the efficiency of queries and determine how a query uses available indexes. Perform Two Phase Commits (page 115) Use two-phase commits when writing data to multiple documents. Update Document if Current (page 122) Update a document only if it has not changed since it was last read. Create Tailable Cursor (page 123) Create tailable cursors for use in capped collections with high numbers of write operations for which an index would be too expensive. Create an Auto-Incrementing Sequence Field (page 125) Describes how to create an incrementing sequence num- ber for the _id field using a Counters Collection or an Optimistic Loop. Chapter 3. MongoDB CRUD Operations 92