
- MongoDB Tutorial
- MongoDB - Home
- MongoDB - Overview
- MongoDB - Advantages
- MongoDB - Environment
- MongoDB - Data Modeling
- MongoDB - Create Database
- MongoDB - Drop Database
- MongoDB - Create Collection
- MongoDB - Drop Collection
- MongoDB - Data Types
- MongoDB - Insert Document
- MongoDB - Query Document
- MongoDB - Update Document
- MongoDB - Delete Document
- MongoDB - Projection
- MongoDB - Limiting Records
- MongoDB - Sorting Records
- MongoDB - Indexing
- MongoDB - Aggregation
- MongoDB - Replication
- MongoDB - Sharding
- MongoDB - Create Backup
- MongoDB - Deployment
- MongoDB - Java
- MongoDB - PHP
- Advanced MongoDB
- MongoDB - Relationships
- MongoDB - Database References
- MongoDB - Covered Queries
- MongoDB - Analyzing Queries
- MongoDB - Atomic Operations
- MongoDB - Advanced Indexing
- MongoDB - Indexing Limitations
- MongoDB - ObjectId
- MongoDB - Map Reduce
- MongoDB - Text Search
- MongoDB - Regular Expression
- Working with Rockmongo
- MongoDB - GridFS
- MongoDB - Capped Collections
- Auto-Increment Sequence
- MongoDB Useful Resources
- MongoDB - Questions and Answers
- MongoDB - Quick Guide
- MongoDB - Useful Resources
- MongoDB - Discussion
What is the maximum size of a document in MongoDB?
The document is a record in a collection. Each document has the limitation of 16 MB size. The document is wrapped inside the curly bracket ({}).
Let us create a collection with documents −
> db.demo748.insertOne({_id:101,Name:"Chris",Age:21}); { "acknowledged" : true, "insertedId" : 101 } > db.demo748.insertOne({_id:102,Name:"Bob",Age:20}); { "acknowledged" : true, "insertedId" : 102 } > db.demo748.insertOne({_id:103,Name:"David",Age:23}); { "acknowledged" : true, "insertedId" : 103 } > db.demo748.insertOne({_id:104,Name:"Sam",Age:19}); { "acknowledged" : true, "insertedId" : 104 }
Display all documents from a collection with the help of find() method −
> db.demo748.find();
This will produce the following output −
{ "_id" : 101, "Name" : "Chris", "Age" : 21 } { "_id" : 102, "Name" : "Bob", "Age" : 20 } { "_id" : 103, "Name" : "David", "Age" : 23 } { "_id" : 104, "Name" : "Sam", "Age" : 19 }
- Related Articles
- What is the MongoDB Capped Collection maximum allowable size?
- Find largest document size in MongoDB?
- Get the real document BSON size in MongoDB?
- What is the maximum size of list in Python?
- Find MongoDB document with array containing the maximum occurrence of a specific value
- What is the maximum size of HTTP header values?
- What is the maximum size of a web browser's cookies value?
- Increment a field in MongoDB document which is embedded?
- Retrieving the first document in a MongoDB collection?
- How to update the _id of a MongoDB Document?
- Maximum size of a element in HTML
- What is the fastest way to update the whole document (all fields) in MongoDB?
- Updating a MongoDB document and adding new keys only in the first document?
- Get the storage size of a database in MongoDB?
- How do you update a MongoDB document while replacing the entire document?

Advertisements