AWS Security ChangesHomeSearch

AWS documentdb documentation change

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

File: documentdb/latest/developerguide/min.md

Summary

Added new documentation page for the $min aggregation operator with MongoDB Shell, Node.js, and Python code examples

Security assessment

This change adds routine documentation for the $min aggregation operator in Amazon DocumentDB. The code examples include standard TLS connection parameters (tls=true, tlsCAFile) which are normal security best practices for database connections, but this is not documenting a new security feature or addressing a specific security vulnerability. The change appears to be standard feature documentation.

Diff

diff --git a/documentdb/latest/developerguide/min.md b/documentdb/latest/developerguide/min.md
index 8b1378917..6d5360cba 100644
--- a//documentdb/latest/developerguide/min.md
+++ b//documentdb/latest/developerguide/min.md
@@ -0,0 +1 @@
+[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#min "Open PDF")
@@ -1,0 +3,114 @@
+[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
+
+Example (MongoDB Shell)Code examples
+
+# $min
+
+The `$min` operator returns the minimum value from an array of values. It can be used in aggregation stages to find the minimum value for a specified field across multiple documents.
+
+**Parameters**
+
+  * `expression`: The expression to evaluate. This can be a field path, a variable, or any expression that resolves to a value.
+
+
+
+
+## Example (MongoDB Shell)
+
+The following example demonstrates the usage of the `$min` operator to find the minimum value of the `age` field across multiple documents.
+
+**Create sample documents**
+    
+    
+    db.users.insertMany([
+      { name: "John", age: 35 },
+      { name: "Jane", age: 28 },
+      { name: "Bob", age: 42 },
+      { name: "Alice", age: 31 }
+    ]);
+
+**Query example**
+    
+    
+    db.users.aggregate([
+      { $group: { _id: null, minAge: { $min: "$age" } } },
+      { $project: { _id: 0, minAge: 1 } }
+    ])
+
+**Output**
+    
+    
+    [ { minAge: 28 } ]
+
+## Code examples
+
+To view a code example for using the `$min` command, choose the tab for the language that you want to use:
+
+Node.js
+    
+    
+    
+    const { MongoClient } = require('mongodb');
+    
+    async function findMinAge() {
+      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 users = db.collection('users');
+    
+      const result = await users.aggregate([
+        { $group: {
+            _id: null,
+            minAge: { $min: "$age" }
+          }}
+      ]).toArray();
+    
+      console.log(result);
+      client.close();
+    }
+    
+    findMinAge();
+
+Python
+    
+    
+    
+    from pymongo import MongoClient
+    
+    def find_min_age():
+        client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false')
+        db = client['test']
+        users = db.users
+    
+        result = list(users.aggregate([
+            { "$group": {
+                "_id": None,
+                "minAge": { "$min": "$age" }
+            }}
+        ]))
+    
+        print(result)
+        client.close()
+    
+    find_min_age()
+
+![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)
+
+$millisecond
+
+$minute
+
+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.