AWS Security ChangesHomeSearch

AWS documentdb documentation change

Service: documentdb · 2026-03-28 · Documentation low

File: documentdb/latest/developerguide/addFields.md

Summary

Removed the entire documentation page for the $addFields aggregation stage in Amazon DocumentDB, including examples, code samples, and usage instructions.

Security assessment

The change completely removes documentation content without any mention of security vulnerabilities, patches, or security-related fixes. This appears to be a routine documentation cleanup or restructuring, not related to addressing any security issue. The removed content was standard feature documentation with no security warnings or security-specific content.

Diff

diff --git a/documentdb/latest/developerguide/addFields.md b/documentdb/latest/developerguide/addFields.md
index 929f60cc8..8b1378917 100644
--- a//documentdb/latest/developerguide/addFields.md
+++ b//documentdb/latest/developerguide/addFields.md
@@ -1 +0,0 @@
-[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#addFields "Open PDF")
@@ -3,154 +1,0 @@
-[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
-
-Example (MongoDB Shell)Code examples
-
-# $addFields
-
-The `$addFields` stage in the Amazon DocumentDB aggregation pipeline allows you to add new computed fields to documents. This can be useful for adding derived or transformed data to the documents.
-
-**Parameters**
-
-  * `newField`: The name of the new field to add.
-
-  * `expression`: An expression that resolves to the value of the new field.
-
-
-
-
-## Example (MongoDB Shell)
-
-The following example demonstrates how to use `$addFields` to add a new field `TotalInventory` that calculates the total inventory based on the `Inventory.OnHand` and `Inventory.OrderQnty` fields.
-
-**Create sample documents**
-    
-    
-    db.example.insertMany([
-      {
-        "Item": "Spray Paint",
-        "Colors": ["Black", "Red", "Green", "Blue"],
-        "Inventory": {
-          "OnHand": 47,
-          "MinOnHand": 50,
-          "OrderQnty": 36
-        },
-        "UnitPrice": 3.99
-      },
-      {
-        "Item": "Ruler",
-        "Colors": ["Red", "Green", "Blue", "Clear", "Yellow"],
-        "Inventory": {
-          "OnHand": 47,
-          "MinOnHand": 40
-        },
-        "UnitPrice": 0.89
-      }
-    ]);
-
-**Query example**
-    
-    
-    db.example.aggregate([
-      {
-        $addFields: {
-          TotalInventory: { $add: ["$Inventory.OnHand", "$Inventory.OrderQnty"] }
-        }
-      }
-    ])
-
-**Output**
-    
-    
-    [
-      {
-        "_id" : ObjectId("5bedafbcf65ff161707de24f"),
-        "Item" : "Ruler",
-        "Colors" : [ "Red", "Green", "Blue", "Clear", "Yellow" ],
-        "Inventory" : {
-          "OnHand" : 47,
-          "MinOnHand" : 40
-        },
-        "UnitPrice" : 0.89,
-        "TotalInventory" : 47
-      },
-      {
-        "_id" : ObjectId("5bedafbcf65ff161707de250"),
-        "Item" : "Spray Paint",
-        "Colors" : [ "Black", "Red", "Green", "Blue" ],
-        "Inventory" : {
-          "OnHand" : 47,
-          "MinOnHand" : 50,
-          "OrderQnty" : 36
-        },
-        "UnitPrice" : 3.99,
-        "TotalInventory" : 83
-      }
-    ]
-
-## Code examples
-
-To view a code example for using the `$addFields` command, choose the tab for the language that you want to use:
-
-Node.js
-    
-    
-    
-    const { MongoClient } = require('mongodb');
-    
-    const client = await MongoClient.connect('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false');
-    const db = client.db('test');
-    const collection = db.collection('example');
-    
-    const result = await collection.aggregate([
-      {
-        $addFields: {
-          TotalInventory: { $add: ['$Inventory.OnHand', '$Inventory.OrderQnty'] }
-        }
-      }
-    ]).toArray();
-    
-    console.log(result);
-    
-    await client.close();
-
-Python
-    
-    
-    
-    from pymongo import MongoClient
-    
-    client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false')
-    db = client['test']
-    collection = db['example']
-    
-    result = list(collection.aggregate([
-        {
-            '$addFields': {
-                'TotalInventory': { '$add': ['$Inventory.OnHand', '$Inventory.OrderQnty'] }
-            }
-        }
-    ]))
-    
-    print(result)
-    client.close()
-
-![Warning](https://d1ge0kk1l5kms0.cloudfront.net/images/G/01/webservices/console/warning.png) **Javascript is disabled or is unavailable in your browser.**
-
-To use the Amazon Web Services Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions.
-
-[Document Conventions](/general/latest/gr/docconventions.html)
-
-$addToSet
-
-$allElementsTrue
-
-Did this page help you? - Yes
-
-Thanks for letting us know we're doing a good job!
-
-If you've got a moment, please tell us what we did right so we can do more of it.
-
-Did this page help you? - No
-
-Thanks for letting us know this page needs work. We're sorry we let you down.
-
-If you've got a moment, please tell us how we can make the documentation better.