AWS Security ChangesHomeSearch

AWS documentdb documentation change

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

File: documentdb/latest/developerguide/replaceAll.md

Summary

Removed entire documentation page for the $replaceAll operator in Amazon DocumentDB, including all examples and code samples.

Security assessment

The change removes general documentation about a database operator ($replaceAll) used for string manipulation. There is no evidence in the diff of addressing a security vulnerability, weakness, or incident. The removed content includes standard usage examples and code samples without any security context or mention of security features.

Diff

diff --git a/documentdb/latest/developerguide/replaceAll.md b/documentdb/latest/developerguide/replaceAll.md
index 3a5301ef2..8b1378917 100644
--- a//documentdb/latest/developerguide/replaceAll.md
+++ b//documentdb/latest/developerguide/replaceAll.md
@@ -1 +0,0 @@
-[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#replaceAll "Open PDF")
@@ -3,190 +1,0 @@
-[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
-
-Example (MongoDB Shell)Code examples
-
-# $replaceAll
-
-Introduced in 5.0
-
-The `$replaceAll` operator in Amazon DocumentDB is used to replace all occurrences of a specified string pattern within a field with a new string. This operator can be useful for tasks such as data normalization, text cleaning, and string manipulation.
-
-**Parameters**
-
-  * `input`: The field or expression containing the string to be replaced.
-
-  * `find`: The string pattern to search for and replace.
-
-  * `replacement`: The string to replace the matched occurrences with.
-
-
-
-
-## Example (MongoDB Shell)
-
-The following example demonstrates how to use the `$replaceAll` operator in an aggregation pipeline to replace all occurrences of the string "Chocolatier" with "Chocolate Co." in the "brandName" field of a "products" collection.
-
-**Create sample documents**
-    
-    
-    db.products.insertMany([
-      {
-        "_id": 1,
-        "productId": "PROD-0Y9GL0",
-        "brandName": "Gordon's Chocolatier",
-        "category": "CPG",
-        "rating": {
-          "average": 4.8
-        }
-      },
-      {
-        "_id": 2,
-        "productId": "PROD-1X2YZ3",
-        "brandName": "Premium Chocolatier",
-        "category": "CPG",
-        "rating": {
-          "average": 4.5
-        }
-      },
-      {
-        "_id": 3,
-        "productId": "PROD-Y2E9H5",
-        "name": "Nutrition Co. - Original Corn Flakes Cereal",
-        "category": "Breakfast Cereals",
-        "price": 8.5
-      }
-    ]);
-
-**Query example**
-    
-    
-    db.products.aggregate([
-      {
-        $addFields: {
-          "brandName": {
-            $replaceAll: {
-              input: "$brandName",
-              find: "Chocolatier",
-              replacement: "Chocolate Co."
-            }
-          }
-        }
-      }
-    ])
-
-**Output**
-    
-    
-    [
-      {
-        _id: 1,
-        productId: 'PROD-0Y9GL0',
-        brandName: "Gordon's Chocolate Co.",
-        category: 'CPG',
-        rating: { average: 4.8 }
-      },
-      {
-        _id: 2,
-        productId: 'PROD-1X2YZ3',
-        brandName: 'Premium Chocolate Co.',
-        category: 'CPG',
-        rating: { average: 4.5 }
-      },
-      {
-        _id: 3,
-        productId: 'PROD-Y2E9H5',
-        name: 'Nutrition Co. - Original Corn Flakes Cereal',
-        category: 'Breakfast Cereals',
-        price: 8.5,
-        brandName: null
-      }
-    ]
-    
-
-## Code examples
-
-To view a code example for using the `$replaceAll` command, choose the tab for the language that you want to use:
-
-Node.js
-    
-    
-    
-    const { MongoClient } = require('mongodb');
-    
-    async function replaceAll() {
-      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('products');
-    
-      const results = await collection.aggregate([
-        {
-          $addFields: {
-            "brandName": {
-              $replaceAll: {
-                input: "$brandName",
-                find: "Chocolatier",
-                replacement: "Chocolate Co."
-              }
-            }
-          }
-        }
-      ]).toArray();
-    
-      console.log(results);
-    
-      await client.close();
-    }
-    
-    replaceAll();
-
-Python
-    
-    
-    
-    from pymongo import MongoClient
-    
-    def replace_all():
-        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.products
-    
-        results = list(collection.aggregate([
-            {
-                "$addFields": {
-                    "brandName": {
-                        "$replaceAll": {
-                            "input": "$brandName",
-                            "find": "Chocolatier",
-                            "replacement": "Chocolate Co."
-                        }
-                    }
-                }
-            }
-        ]))
-    
-        print(results)
-    
-        client.close()
-    
-    replace_all()
-
-![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)
-
-$regexMatch
-
-$replaceOne
-
-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.