Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8013443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:38:00+00:00 2026-06-04T19:38:00+00:00

Ok I am new to MongoDB and been reading a book about it, some

  • 0

Ok I am new to MongoDB and been reading a book about it, some where it is saying

“Documents larger than 4MB (when converted to BSON ) cannot be saved
to database “

Ok…4MB cap for documents? The thing that confused me is the thing they say in parenthesis : ( when converted to BSON ) : So the size is getting changed when converted to BSON?

because a few line later it is saying:

“To give you an idea of how much 4MB is, the entire text of War and
Peace
is just 3.14 MB “

What? Ok now I am confused. Help Me!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:38:02+00:00Added an answer on June 4, 2026 at 7:38 pm

    In theory, the BSON file also contains the field names which take up space and some overhead. In general, the overhead is not more than a few bytes. Besides some document overhead (a few bytes), each value stored also has some additional storage bytes. For a simple string it’s 6 bytes extra (1 for the type, 4 for the length and 1 for a trailing \0 character). You can see the overhead on the bsonspec.org website. The length of a simple string itself doesn’t change “when converted to BSON”, but the addition of the length etc makes it a tiny bit larger. Most of the drivers have a helper function to figure out how large a document would be. In PHP you would do:

    <?php
    $document = array(
        '_id' => new MongoId(),
        'name' => 'Derick'
    );
    echo strlen(bson_encode($document)), "\n";
    ?>
    

    Which in this case prints 39.

    Also, the current document limit is 16 MB- it has changed since the book was written.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to MongoDB and trying out some fundamentals, but this astonished me. I'm
I'm new to Rails development and I'm starting with MongoDB also. I have been
I have been very excited about MongoDb and have been testing it lately. I
I have been getting some strange errors with Mongodb, and in Mongodb, you are
I've been reading up on MongoDB. I am particularly interested in the aggregation frameworks
I've been doing some tests with mongodb and sharding and at some point I
So i'm new with mongodb and mapreduce in general and came across this "quirk"
I'm new on mongoDB and the point is, that we new realize an bug
I am making a new application in MongoDB, and I have found that the
I am using mongoDB for a new project at work and I got into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.