AWS documentdb documentation change
Summary
Entire documentation page for the $strLenBytes operator has been removed, including all content, examples, and code samples
Security assessment
This change removes documentation for a specific MongoDB operator ($strLenBytes) but provides no evidence of security vulnerability, incident, or security-related context. The removal appears to be part of documentation restructuring or deprecation of content, not addressing a security issue. No security features are added.
Diff
diff --git a/documentdb/latest/developerguide/strLenBytes.md b/documentdb/latest/developerguide/strLenBytes.md index 9ca286726..8b1378917 100644 --- a//documentdb/latest/developerguide/strLenBytes.md +++ b//documentdb/latest/developerguide/strLenBytes.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#strLenBytes "Open PDF") @@ -3,127 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $strLenBytes - -The `$strLenBytes` operator in Amazon DocumentDB is used to determine the length of a string in bytes. This is useful when you need to understand the storage size of a string field, especially when dealing with Unicode characters that may use more than one byte per character. - -**Parameters** - - * `expression`: The string expression to calculate the length of. - - - - -## Example (MongoDB Shell) - -This example demonstrates how to use the `$strLenBytes` operator to calculate the length of string fields in bytes. - -**Create sample documents** - - - db.people.insertMany([ - { "_id": 1, "Desk": "Düsseldorf-BVV-021" }, - { "_id": 2, "Desk": "Munich-HGG-32a" }, - { "_id": 3, "Desk": "Cologne-ayu-892.50" }, - { "_id": 4, "Desk": "Dortmund-Hop-78" } - ]); - -**Query example** - - - db.people.aggregate([ - { - $project: { - "Desk": 1, - "length": { $strLenBytes: "$Desk" } - } - } - ]) - -**Output** - - - { "_id" : 1, "Desk" : "Düsseldorf-BVV-021", "length" : 19 } - { "_id" : 2, "Desk" : "Munich-HGG-32a", "length" : 14 } - { "_id" : 3, "Desk" : "Cologne-ayu-892.50", "length" : 18 } - { "_id" : 4, "Desk" : "Dortmund-Hop-78", "length" : 15 } - -Note that the length of the "Düsseldorf-BVV-021" string is 19 bytes, which is different from the number of code points (18) due to the Unicode character "Ü" occupying 2 bytes. - -## Code examples - -To view a code example for using the `$strLenBytes` 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('people'); - - const result = await collection.aggregate([ - { - $project: { - "Desk": 1, - "length": { $strLenBytes: "$Desk" } - } - } - ]).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 - collection = db.people - - result = list(collection.aggregate([ - { - '$project': { - "Desk": 1, - "length": { "$strLenBytes": "$Desk" } - } - } - ])) - - print(result) - client.close() - - example() - - **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) - -$sqrt - -$strLenCP - -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.