AWS Security ChangesHomeSearch

AWS documentdb documentation change

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

File: documentdb/latest/developerguide/concat.md

Summary

Added new documentation page for the $concat aggregation operator in Amazon DocumentDB with examples in MongoDB Shell, Node.js, and Python

Security assessment

This is routine documentation addition for an aggregation operator ($concat) that concatenates strings. The change includes standard connection examples with TLS parameters but doesn't address any specific security vulnerability or weakness. The documentation focuses on functionality rather than security features, and the TLS connection examples are standard secure practices already documented.

Diff

diff --git a/documentdb/latest/developerguide/concat.md b/documentdb/latest/developerguide/concat.md
index 8b1378917..79cf63545 100644
--- a//documentdb/latest/developerguide/concat.md
+++ b//documentdb/latest/developerguide/concat.md
@@ -0,0 +1 @@
+[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#concat "Open PDF")
@@ -1,0 +3,112 @@
+[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
+
+Example (MongoDB Shell)Code examples
+
+# $concat
+
+The `$concat` aggregation operator in Amazon DocumentDB concatenates (or combines) multiple strings in a document to produce a single string that can be returned to the application. This reduces the work done in the application, as the string manipulation is performed at the database level.
+
+**Parameters**
+
+  * `expression1`: The first string to concatenate.
+
+  * `expression2`: The second string to concatenate.
+
+  * `...`: Additional strings to concatenate (optional).
+
+
+
+
+## Example (MongoDB Shell)
+
+In this example, we concatenate the first and last names of users to produce each person's full name.
+
+**Create sample documents**
+    
+    
+    db.people.insertMany([
+      { "_id":1, "first_name":"Jane", "last_name":"Doe", "DOB":"2/1/1999", "Desk": "MSP102-MN"},
+      { "_id":2, "first_name":"John", "last_name":"Doe", "DOB":"12/21/1992", "Desk": "DSM301-IA"},
+      { "_id":3, "first_name":"Steve", "last_name":"Smith", "DOB":"3/21/1981", "Desk":"MKE233-WI"}
+    ])
+
+**Query example**
+    
+    
+    db.people.aggregate([
+      { $project: { full_name: { $concat: [ "$first_name", " ", "$last_name"] } } }
+    ])
+
+**Output**
+    
+    
+    { "_id" : 1, "full_name" : "Jane Doe" }
+    { "_id" : 2, "full_name" : "John Doe" }
+    { "_id" : 3, "full_name" : "Steve Smith" }
+
+## Code examples
+
+To view a code example for using the `$concat` command, choose the tab for the language that you want to use:
+
+Node.js
+    
+    
+    
+    const { MongoClient } = require('mongodb');
+    
+    async function concatenateNames() {
+      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 result = await db.collection('people').aggregate([
+        { $project: { full_name: { $concat: [ "$first_name", " ", "$last_name"] } } }
+      ]).toArray();
+    
+      console.log(result);
+    
+      await client.close();
+    }
+    
+    concatenateNames();
+
+Python
+    
+    
+    
+    from pymongo import MongoClient
+    
+    def concatenate_names():
+        client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false')
+        db = client['test']
+    
+        result = list(db.people.aggregate([
+            { '$project': { 'full_name': { '$concat': [ '$first_name', ' ', '$last_name' ] } } }
+        ]))
+    
+        print(result)
+    
+        client.close()
+    
+    concatenate_names()
+
+![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)
+
+$collStats
+
+$concatArrays
+
+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.