AWS Security ChangesHomeSearch

AWS documentdb documentation change

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

File: documentdb/latest/developerguide/dateTrunc.md

Summary

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

Security assessment

The change removes feature documentation entirely. There is no evidence in the diff that this removal is related to a security vulnerability, weakness, or incident. The removed content consists of standard operator documentation and examples. No security context, warnings, or vulnerability disclosures are present in the removed text.

Diff

diff --git a/documentdb/latest/developerguide/dateTrunc.md b/documentdb/latest/developerguide/dateTrunc.md
index 851152cac..8b1378917 100644
--- a//documentdb/latest/developerguide/dateTrunc.md
+++ b//documentdb/latest/developerguide/dateTrunc.md
@@ -1 +0,0 @@
-[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#dateTrunc "Open PDF")
@@ -3,163 +1,0 @@
-[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
-
-Example (MongoDB Shell)Code examples
-
-# $dateTrunc
-
-New from version 8.0
-
-Not supported by Elastic cluster.
-
-The `$dateTrunc` aggregation operator in Amazon DocumentDB truncates a date to a specified unit.
-
-**Parameters**
-
-  * `date`: A date expression that resolves to a date or timestamp.
-
-  * `unit`: A string that specifies the time unit for the subtrahend expression. Supported units are `year`, `quarter`, `month`, `week`, `day`, `hour`, `minute`, `second`, and `millisecond`.
-
-
-
-
-## Example (MongoDB Shell)
-
-The following example demonstrates how to use the `$dateTrunc` operator to truncate a date to to the hour.
-
-**Create sample documents**
-    
-    
-    db.events.insertMany([
-      {
-        eventName: "Event 1",
-        eventTime: ISODate("2025-04-01T12:15:00Z")
-      },
-      {
-        eventName: "Event 2",
-        eventTime: ISODate("2025-08-15T14:33:22Z")
-      },
-    ]);
-
-**Query example**
-    
-    
-    db.events.aggregate([
-      {
-        $project: {
-          eventName: 1,
-          eventTime: 1,
-          truncatedToHour: {
-            $dateTrunc: {
-              date: "$eventTime",
-              unit: "hour"
-            }
-          }
-        }
-      }
-    ]);
-
-**Output**
-    
-    
-    [
-      {
-        _id: ObjectId('6924a258d66dcae121d29515'),
-        eventName: 'Event 1',
-        eventTime: ISODate('2025-04-01T12:15:00.000Z'),
-        truncatedToHour: ISODate('2025-04-01T12:00:00.000Z')
-      },
-      {
-        _id: ObjectId('6924a258d66dcae121d29516'),
-        eventName: 'Event 2',
-        eventTime: ISODate('2025-08-15T14:33:22.000Z'),
-        truncatedToHour: ISODate('2025-08-15T14:00:00.000Z')
-      }
-    ]
-
-## Code examples
-
-To view a code example for using the `$dateTrunc` 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');
-      const db = client.db('test');
-      const events = db.collection('events');
-      
-      const result = await events.aggregate([
-        {
-          $project: {
-            eventName: 1,
-            eventTime: 1,
-            truncatedToHour: {
-              $dateTrunc: {
-                date: "$eventTime",
-                unit: "hour"
-              }
-            }
-          }
-        }
-      ]).toArray();
-      
-      console.log(result);
-      client.close();
-    }
-    
-    example();
-
-Python
-    
-    
-    
-    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')
-        db = client['test']
-        events = db['events']
-        
-        result = list(events.aggregate([
-            {
-                "$project": {
-                    "eventName": 1,
-                    "eventTime": 1,
-                    "truncatedToHour": {
-                        "$dateTrunc": {
-                            "date": "$eventTime",
-                            "unit": "hour"
-                        }
-                    }
-                }
-            }
-        ]))
-        
-        print(result)
-        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)
-
-$dateToString
-
-$dayOfMonth
-
-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.