-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:
Description
In 4.4 we're adding a feature called user-defined functions (UDFs), which lets users embed Javascript in an aggregation pipeline using the new $function and $accumulator operators. This removes one of the last few things that mapReduce can do that aggregation pipelines can't, so we can add more advice to steer people away from mapReduce and toward aggregation pipelines.
On this page: https://docs.mongodb.com/manual/core/server-side-javascript/index.html
We should include $function and $accumulator in the list of operators that can run Javascript.Under "Disable..." we should mention that as of 4.4, mongos can run Javascript, so if you want to disable Javascript in your cluster then you need to pass --noscripting or security.javascriptEnabled: false to mongos in addition to mongod.
These three pages look like likely entry points for mapReduce, so we may want to link to aggregation near the top:
- https://docs.mongodb.com/manual/reference/command/mapReduce/index.html
- https://docs.mongodb.com/manual/reference/method/db.collection.mapReduce/index.html
https://docs.mongodb.com/manual/core/map-reduce/index.html
I think this sentence is no longer true: "In addition to grouping operations, can perform complex aggregation tasks as well as perform incremental aggregation on continuously growing datasets."
https://docs.mongodb.com/manual/reference/aggregation-commands-comparison/index.html
I think "incremental aggregation" refers to mapReduce's ability to merge results with an existing collection. As of 4.2, aggregation can do this using $merge.I think "complex aggregation tasks" refers to mapReduce's ability to run arbitrary Javascript. As of 4.4, aggregation can also run Javascript.
In the mapReduce tutorial, "Various map-reduce operations can be rewritten".
https://docs.mongodb.com/manual/tutorial/perform-incremental-map-reduce/index.html
We could probably strengthen this a little, by saying "All" or "Almost all" instead of "Various".We could possibly mention $function and $accumulator, so people realize they aren't losing flexibility by starting with an agg pipeline.- We could possibly reuse this box on the other pages that talk about mapReduce, in case someone lands there directly.
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
- is related to
-
DOCS-13387 Investigate changes in SERVER-45456: Allow JavaScript on mongos
- Closed