Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe one of the original reasons behind storing the key names with the documents is to allow a more easily scalable <a href="http://blog.mongodb.org/post/119945109/why-schemaless" rel="nofollow">schema-less</a> database. Each document is self-contained to a greater extent, in that if you move the document to another server (for example, via replication or sharding) you can index the contents of the document without having to reference separate or centralized metadata such as a mapping of key names to more compact key IDs.</p> <p>Since there is no enforced schema for a MongoDB collection, the field names can potentially be different for every document in the same collection. In a <a href="http://www.mongodb.org/display/DOCS/Sharding" rel="nofollow">sharded</a> environment, inserts to each shard are (intentionally) independent so at a document level the raw data could end up differing unless the key mapping was able to be consistent per shard.</p> <p>Depending on your use case, the key names may or may not consume a significant amount of space relative to the accompanying data. You could always workaround the storage concern from the application / ODM implementation by mapping YourFriendlyKeyNames to shorter DB key equivalents.</p> <p>There is an open MongoDB Jira issue and some further discussion to <a href="https://jira.mongodb.org/browse/SERVER-863" rel="nofollow">have the server tokenize field names</a>, which you can vote on to help prioritize including this feature in a future release.</p> <p>MongoDB's current design goals include performance with dynamic schemas, replication &amp; high availability, auto-sharding, and in-place updates .. with one potential tradeoff being some extra disk usage.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload