[DOCS-13590] Update mapReduce advice now that we have UDFs Created: 13/Apr/20  Updated: 30/Oct/23  Resolved: 14/Apr/20

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: David Percy Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: docs-aggregation, docs-query
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-13387 Investigate changes in SERVER-45456: ... Closed
Participants:
Days since reply: 3 years, 43 weeks, 1 day ago
Epic Link: DOCS: 4.4 Server Release Work

 Description   

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



 Comments   
Comment by Githook User [ 14/Apr/20 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-13590: include note about aggregation at top of m-r command and method page
Branch: master
https://github.com/mongodb/docs/commit/10091058354fa2ef1d4fc0c0c390d7f0ae2f435f

Comment by David Percy [ 14/Apr/20 ]

Sorry, I was looking at the 4.2 docs instead of the upcoming 4.4 docs. I've tried to cross out everything that doesn't make sense or is already done. I guess what's left is only a suggestion to add those Note boxes to more pages, in case people land there directly from a link or search engine.

Comment by Ravind Kumar (Inactive) [ 13/Apr/20 ]

cc kay.kim

Generated at Thu Feb 08 08:08:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.