https://docs.mongodb.org/manual/reference/method/db.collection.mapReduce/#mapreduce-OUT-MTD
The following is a description of the MapReduce output
Output to a Collection with an Action
This option was only available when passing a collection the already exists to out. It is not available on secondary members of replica sets.
Out: {<action>: <collectionName>
[, DB: <dbname>]
[, sharded: <boolean>]
[, Nonatomic: <boolean>]}
When you output to a collection with an action, the out has the following parameters:
<action>: Specify one of the following actions:
Replace
Replace the contents of the <collectionName> if the collection with the<collectionname> exists.
Merge
Merge The new result with the existing result if the output collection already exists. If the existing document has the same key as the new result, overwrite that existing document.
Reduce
Merge The new result with the existing result if the output collection already exists. If the existing document has the same key as the new result, apply the reduce function to both the new and the existing doc Uments and overwrite the existing document with the result.
Db:
Optional. The name of the database is want the map-reduce operation to write its output. By default this would be the same database as the input collection.
Sharded:
Optional. If true and you have an enabled sharding on output database, the map-reduce operation would shard the output collection using The _id field as the Shard key.
Nonatomic: