542179528 发表于 2015-7-7 10:20:52

mongodb/mapreduce

  


MapReduce

  






  Map/reduce in MongoDB is useful for batch processing of
data and aggregation operations. It is similar in spirit to using
something like Hadoop with all input coming from a collection and output
going to a collection.Often, in a situation where you would have used
GROUP BY in SQL, map/reduce is the right tool in MongoDB.







http://www.mongodb.org/images/icons/emoticons/warning.gif
Indexing
and standard queries in MongoDB are separate from map/reduce.If you
have used CouchDB in the past, note this is a big difference: MongoDB is
more like MySQL for basic querying and indexing.See the queries and indexing documentation for those operations.






[*]Overview

[*]

[*]Output options
[*]Result object


[*]Map Function
[*]Reduce Function
[*]Finalize Function


[*]Sharded Environments
[*]Examples

[*]Shell Example 1
[*]Shell Example 2
[*]More Examples
[*]Note on Permanent Collections


[*]Parallelism
[*]Presentations
[*]See Also
  


Overview
  map/reduce is invoked via a database command.
The database creates a temporary collection to hold output of the
operation.The collection is cleaned up when the client connection
closes, or when explicitly dropped. Alternatively, one can specify a
permanent output collection name.map and reduce functions are written in JavaScript and execute on the server.
  Command syntax:





db.runCommand(
{ mapreduce : ,
map : ,
reduce :
[, query : ]
[, sort : ]
[, limit : ]
[, out : ]
[, keeptemp: ]
[, finalize : ]
[, scope : ]
[, verbose : true]
}
);

  * keeptemp - if true, the generated collection is not treated as temporary. Defaults to false.When out is specified, the collection is automatically made permanent. (MongoDB
页: [1]
查看完整版本: mongodb/mapreduce