摘要:Sharding refers to the process of splitting data up and storing different portions of thedata on different machines; the term partitioning is also sometimes used to describethis concept. By splitting ...
阅读全文
摘要:A replica set is basically a master-slave cluster with automatic failover. The biggestdifference between a master-slave cluster and a replica set is that a replica set does nothave a single master: on...
阅读全文
摘要:MongoDB supports reading configuration information from a file. This can be usefulif you have a large set of options you want to use or are automating the task ofstarting up MongoDB. To tell the serve...
阅读全文
摘要:In addition to these basic operations, MongoDB supports a wide rangeof advanced operations that are implemented as commands. Commands implement allof the functionality that doesn’t fit neatly in...
阅读全文
摘要:MapReduce is the Uzi of aggregation tools. Everything described with count, distinct, and group can be done with MapReduce, and more. It is a method of aggregation that can be easily parallelized acro...
阅读全文
摘要:explain is an incredibly handy tool that will give you lots of information about your queries. You can run it on any query by tacking it on to a cursor. explain returns a document, not the cursor itse...
阅读全文
摘要:Sometimes, you do not need all of the key/value pairs in a document returned. If thisis the case, you can pass a second argument to find (or findOne) specifying the keys youwant. This reduces both the...
阅读全文
摘要:"$set" sets the value of a key. If the key does not yet exist, it will be created. This canbe handy for updating schema or adding user-defined keys. The "$inc" modifier can be used to change the valu...
阅读全文