Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13590

Update mapReduce advice now that we have UDFs

      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:

      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

      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.)

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              4 years, 3 weeks ago