AWS Security ChangesHomeSearch

AWS documentdb documentation change

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

File: documentdb/latest/developerguide/all.md

Summary

Added comprehensive documentation for the $all operator in Amazon DocumentDB, including syntax, parameters, limitations, examples in MongoDB Shell, and code examples in Node.js and Python with TLS connection details

Security assessment

This change adds new documentation for the $all operator functionality. While it includes TLS connection parameters in code examples (tls=true, tlsCAFile=global-bundle.pem) which demonstrates secure connection practices, there is no evidence this addresses a specific security vulnerability or incident. The documentation primarily focuses on query operator functionality rather than security fixes.

Diff

diff --git a/documentdb/latest/developerguide/all.md b/documentdb/latest/developerguide/all.md
index 8b1378917..05ecddf6f 100644
--- a//documentdb/latest/developerguide/all.md
+++ b//documentdb/latest/developerguide/all.md
@@ -0,0 +1 @@
+[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#all "Open PDF")
@@ -1,0 +3,118 @@
+[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
+
+Example (MongoDB Shell)Code examples
+
+# $all
+
+The `$all` operator in Amazon DocumentDB is used to match documents where the value of a field is an array and contains all the specified elements, regardless of the order of the elements in the array.
+
+**Parameters**
+
+  * `field`: The name of the field to check.
+
+  * `[value1, value2, ...]`: The list of values to match in the array.
+
+
+
+
+**Using`$elemMatch` within an `$all` expression**
+
+See [Using $elemMatch within an $all expression](./functional-differences.html#functional-differences.elemMatch) for limitations regarding the use of the `$elemMatch` operator within an `$all` expression.
+
+**Dollar ($) in field names**
+
+See [Dollar($) and dot(.) in field names](./functional-differences.html#functional-differences-dollardot) for limitations regarding querying `$` prefixed fields in `$all` in nested objects.
+
+## Example (MongoDB Shell)
+
+The following example demonstrates the usage of the `$all` operator to retrieve documents where the "Colors" field is an array that contains both "Red" and "Blue".
+
+**Create sample documents**
+    
+    
+    db.example.insertMany([
+      { "Item": "Pen", "Colors": ["Red", "Blue", "Green"] },
+      { "Item": "Notebook", "Colors": ["Blue", "White"] },
+      { "Item": "Poster Paint", "Colors": ["Red", "Yellow", "White"] }
+    ])
+
+**Query example**
+    
+    
+    db.example.find({ "Colors": { $all: ["Red", "Blue"] } }).pretty()
+
+**Output**
+    
+    
+    {
+      "_id" : ObjectId("6137d6c5b3a1d35e0b6ee6ad"),
+      "Item" : "Pen",
+      "Colors" : [ 
+              "Red", 
+              "Blue", 
+              "Green" 
+      ]
+    }
+
+## Code examples
+
+To view a code example for using the `$all` 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 collection = db.collection('example');
+    
+      const result = await collection.find({ "Colors": { $all: ["Red", "Blue"] } }).toArray();
+      console.log(result);
+    
+      await 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']
+        collection = db['example']
+    
+        result = list(collection.find({ "Colors": { "$all": ["Red", "Blue"] } }))
+        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)
+
+$
+
+$and
+
+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.