AWS Security ChangesHomeSearch

AWS documentdb documentation change

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

File: documentdb/latest/developerguide/subtract.md

Summary

Entire documentation page for the $subtract operator in Amazon DocumentDB has been removed, including examples, code samples, and usage instructions.

Security assessment

This change removes documentation content entirely but shows no evidence of addressing a security vulnerability, weakness, or incident. The removed content appears to be standard operator documentation with no security context mentioned. The change could potentially impact security if it removes important security guidance, but there's no evidence of that in the diff content.

Diff

diff --git a/documentdb/latest/developerguide/subtract.md b/documentdb/latest/developerguide/subtract.md
index 4f41aa8df..8b1378917 100644
--- a//documentdb/latest/developerguide/subtract.md
+++ b//documentdb/latest/developerguide/subtract.md
@@ -1 +0,0 @@
-[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#subtract "Open PDF")
@@ -3,163 +1,0 @@
-[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
-
-Example (MongoDB Shell)Code examples
-
-# $subtract
-
-The `$subtract` operator in Amazon DocumentDB is used to subtract values. It can be used to subtract dates, numbers, or a combination of both. This operator is useful for calculating the difference between two dates or subtracting a value from a number.
-
-**Parameters**
-
-  * `expression1`: The first value to be subtracted.
-
-  * `expression2`: The second value to be subtracted from `<expression1>`.
-
-
-
-
-## Example (MongoDB Shell)
-
-The following example demonstrates how to use the `$subtract` operator to calculate the difference between two dates.
-
-**Create sample document**
-    
-    
-    db.dates.insert([
-      {
-      "_id": 1,
-      "startDate": ISODate("2023-01-01T00:00:00Z"),
-      "endDate": ISODate("2023-01-05T12:00:00Z")
-      }
-    ]);
-
-**Query example**
-    
-    
-    db.dates.aggregate([
-      {
-        $project: {
-          _id: 1,
-          durationDays: {
-            $divide: [
-              { $subtract: ["$endDate", "$startDate"] },
-              1000 * 60 * 60 * 24  // milliseconds in a day
-            ]
-          }
-        }
-      }
-    ]);
-
-**Output**
-    
-    
-    [ { _id: 1, durationDays: 4.5 } ]
-
-In this example, the `$subtract` operator is used to calculate the difference between the `$endDate` and `$startDate` in days.
-
-## Code examples
-
-To view a code example for using the `$subtract` command, choose the tab for the language that you want to use:
-
-Node.js
-    
-    
-    
-    const { MongoClient } = require('mongodb');
-    
-    async function example() {
-      const client = await MongoClient.connect('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false');
-    
-      try {
-        await client.connect();
-        const db = client.db('test');
-        const collection = db.collection('dates');
-    
-        const pipeline = [
-          {
-            $project: {
-              _id: 1,
-              durationDays: {
-                $divide: [
-                  { $subtract: ["$endDate", "$startDate"] },
-                  1000 * 60 * 60 * 24  // Convert milliseconds to days
-                ]
-              }
-            }
-          }
-        ];
-    
-        const results = await collection.aggregate(pipeline).toArray();
-    
-        console.dir(results, { depth: null });
-    
-      } finally {
-        await client.close();
-      }
-    }
-    
-    example().catch(console.error);
-    
-
-Python
-    
-    
-    
-    from datetime import datetime, timedelta
-    from pymongo import MongoClient
-    
-    def example():
-      
-        client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false')
-    
-        try:
-            db = client.test
-            collection = db.dates
-    
-            pipeline = [
-                {
-                    "$project": {
-                        "_id": 1,
-                        "durationDays": {
-                            "$divide": [
-                                { "$subtract": ["$endDate", "$startDate"] },
-                                1000 * 60 * 60 * 24  # Convert milliseconds to days
-                            ]
-                        }
-                    }
-                }
-            ]
-    
-            results = collection.aggregate(pipeline)
-    
-            for doc in results:
-                print(doc)
-    
-        except Exception as e:
-            print(f"An error occurred: {e}")
-    
-        finally:
-            client.close()
-    
-    example()
-
-![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)
-
-$substrCP
-
-$sum
-
-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.