[DOCS-12627] Docs for SERVER-40381: Add the ability to specify a pipeline to an update command Created: 12/Apr/19  Updated: 13/Nov/23  Resolved: 11/Jun/19

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.1.11, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-40381 Add the ability to specify a pipeline... Closed
Duplicate
Related
related to DOCS-12688 Docs for SERVER-40408: Add pipeline v... Closed
Participants:
Days since reply: 4 years, 35 weeks, 1 day ago
Epic Link: DOCS: 4.2 Server/Tools

 Description   

Description

Description:

This commit allows user to specify an aggregation pipeline to an update command for the "u" argument. It supports the $addFields, $project and $replaceRoot stages and allows users to manipulate documents using these stages and aggregation expressions.

Engineering Ticket Description:

Extend the update command to take an object or an array:

{
   update: <collection>,
   updates: [
      { q: <query>, u: <update obj OR update pipeline>, upsert: <boolean>,
        multi: <boolean>, collation: <document>, arrayFilters: <array> },
      { q: <query>, u: <update obj OR update pipeline>, upsert: <boolean>,
        multi: <boolean>, collation: <document>, arrayFilters: <array> },
      ...
   ],
   ordered: <boolean>,
   writeConcern: { <write concern> },
   bypassDocumentValidation: <boolean>
}

For this task, the only supported stages will be $addFields, $project, and $replaceRoot.

For this task, we should ban other options such as 'collation', 'bypassDocumentValidation', 'writeConcern', 'arrayFilters'. All except 'arrayFilters' will eventually be supported, but will be tracked by separate tickets.

*note* : per DOCS-12724 – it is available with*OUT* feature flag.

Scope of changes

  • source/reference/command/update and associated args file
  • source/reference/method/db.collection.update.txt and associated args file
  • source/reference/method/db.collection.updateOne.txt and associated args file
  • source/reference/method/db.collection.updateMany.txt and associated args file (although not yet changed)
  • source/release-notes/4.2.txt
  • /tutorial/update-documents under CRUD section – only mentioning at end as a blurb since this page is mostly a beginner page
  • Bulk Write Operations –
  • /db.collection.bulkWrite() ref page but have them refer to the updateOne() and updateMany() page for details. No specific example.
  • /core/bulk-write-operations - Didn't mention it since the page refers to the bulkWrite page for the updates which mentions the change
  • Bulk.find.updateOne() and Bulk.find.update() – only modify the parameter table to prefer the bulkWrite()
  • some files to consolidate content regarding the agg availability for findAndModify and updates

Out of Scope

The update page needs overhaul, particularly in the examples section to
be more cohesive. This will not be tackled as part of this feature
ticket. Instead, will be handled separately, like we did the find page.

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 11/Jun/19 ]

Author:

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

Message: DOCS-12627, DOCS-12688: update and aggregation
Branch: master
https://github.com/mongodb/docs/commit/ba458a6e2fc32029d1008409d02df9461ec8899c

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