AWS Security ChangesHomeSearch

AWS documentdb documentation change

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

File: documentdb/latest/developerguide/substrCP.md

Summary

Entire documentation page for the $substrCP operator has been removed, including all content, examples, and code samples

Security assessment

This change removes documentation for a specific MongoDB operator ($substrCP) but provides no evidence of security vulnerability, incident, or security-related context. The removal appears to be routine documentation cleanup or reorganization rather than addressing a security issue. No security warnings, vulnerabilities, or security-related content was present in the removed material.

Diff

diff --git a/documentdb/latest/developerguide/substrCP.md b/documentdb/latest/developerguide/substrCP.md
index c0b3c8c7e..8b1378917 100644
--- a//documentdb/latest/developerguide/substrCP.md
+++ b//documentdb/latest/developerguide/substrCP.md
@@ -1 +0,0 @@
-[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#substrCP "Open PDF")
@@ -3,124 +1,0 @@
-[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
-
-Example (MongoDB Shell)Code examples
-
-# $substrCP
-
-The `$substrCP` operator in Amazon DocumentDB is used to extract a substring from a string, where the substring is specified as a range of UTF-8 code points (CP). This operator is particularly useful when working with Unicode strings, as it allows you to extract substrings without having to worry about the underlying byte representation of the characters.
-
-Unlike the `$substrBytes` operator, which operates on byte positions, the `$substrCP` operator works with code point positions. This makes it easier to work with strings that contain non-ASCII characters, as the number of code points may not match the number of bytes or characters.
-
-**Parameters**
-
-  * `string`: The input string from which to extract the substring.
-
-  * `start`: The starting code point position (zero-based) from which to extract the substring.
-
-  * `length`: The number of code points to extract.
-
-
-
-
-## Example (MongoDB Shell)
-
-In this example, we'll use the `$substrCP` operator to extract the state abbreviation from a string containing the employee's desk location.
-
-**Create sample documents**
-    
-    
-    db.people.insert([
-      { "_id": 1, "first_name": "Jane", "last_name": "Doe", "Desk": "12 Main St, Minneapolis, MN 55401" },
-      { "_id": 2, "first_name": "John", "last_name": "Doe", "Desk": "456 Oak Rd, New Orleans, LA 70032" },
-      { "_id": 3, "first_name": "Steve", "last_name": "Smith", "Desk": "789 Elm Ln, Bakersfield, CA 93263" }
-    ]);
-
-**Query example**
-    
-    
-    db.people.aggregate([
-      {
-        $project: {
-          "state": { $substrCP: ["$Desk", 25, 2] }
-        }
-      }
-    ]);
-
-**Output**
-    
-    
-    { "_id" : 1, "state" : "MN" }
-    { "_id" : 2, "state" : "LA" }
-    { "_id" : 3, "state" : "CA" }
-
-In this example, we know that the state abbreviation starts at the 25th code point in the `Desk` field and is 2 code points long. By using the `$substrCP` operator, we can extract the state abbreviation without having to worry about the underlying byte representation of the string.
-
-## Code examples
-
-To view a code example for using the `$substrCP` command, choose the tab for the language that you want to use:
-
-Node.js
-    
-    
-    
-    const { MongoClient } = require('mongodb');
-    
-    async function findStates() {
-      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: {
-            "state": { $substrCP: ["$Desk", 25, 2] }
-          }
-        }
-      ]).toArray();
-      console.log(result);
-      client.close();
-    }
-    
-    findStates();
-
-Python
-    
-    
-    
-    from pymongo import MongoClient
-    
-    def find_states():
-        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': {
-                    'state': { '$substrCP': ['$Desk', 25, 2] }
-                }
-            }
-        ]))
-        print(result)
-        client.close()
-    
-    find_states()
-
-In both the Node.js and Python examples, we use the `$substrCP` operator to extract the state abbreviation from the `Desk` field, similar to the MongoDB Shell 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)
-
-$substrBytes
-
-$subtract
-
-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.