AWS documentdb documentation change
Summary
Removed entire documentation for the $redact aggregation stage in Amazon DocumentDB, including all examples and usage instructions
Security assessment
The change removes documentation about the $redact aggregation operator, which is a data filtering feature used to control document visibility based on field values. While $redact can be used for security purposes like data redaction, the removal of documentation itself doesn't indicate a security issue. This appears to be a documentation restructuring or deprecation of content, not a response to a security vulnerability. No security warnings, vulnerabilities, or incidents are mentioned in the removed content.
Diff
diff --git a/documentdb/latest/developerguide/redact.md b/documentdb/latest/developerguide/redact.md index 9f4a5cadb..8b1378917 100644 --- a//documentdb/latest/developerguide/redact.md +++ b//documentdb/latest/developerguide/redact.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#redact "Open PDF") @@ -3,141 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $redact - -The `$redact` aggregation stage in Amazon DocumentDB is used to selectively include or exclude content from the output documents based on the values of specified fields. This is particularly useful in scenarios where you need to control the visibility of sensitive data based on access levels or user permissions. - -**Parameters** - - * `$cond`: An expression that evaluates to either `$$KEEP`, `$$PRUNE`, or `$$DESCEND` for each field in the document. - - * `$$KEEP`: Retains the current field in the output document. - - * `$$PRUNE`: Removes the current field from the output document. - - * `$$DESCEND`: Recursively applies the `$redact` stage to the current field, which is an object or array. - - - - -## Example (MongoDB Shell) - -In this example, we'll use the `$redact` stage to filter orders based on their status, showing only orders with specific status values. - -**Create sample documents** - - - db.orders.insert([ - { "_id": 1, "status": "shipped", "customer": "Carlos Salazar", "total": 150.00, "date": "2025-01-15" }, - { "_id": 2, "status": "processing", "customer": "Saanvi Sarkar", "total": 89.99, "date": "2025-01-20" }, - { "_id": 3, "status": "cancelled", "customer": "Zhang Wei", "total": 220.50, "date": "2025-01-18" } - ]) - -**Query example** - - - db.orders.aggregate([ - { - $redact: { - $cond: { - if: { $in: ["$status", ["shipped", "processing"]] }, - then: "$$KEEP", - else: "$$PRUNE" - } - } - } - ]) - -**Output** - - - [ - { _id: 1, status: 'shipped', customer: 'Carlos Salazar', total: 150, date: '2025-01-15' }, - { _id: 2, status: 'processing', customer: 'Saanvi Sarkar', total: 89.99, date: '2025-01-20' } - ] - -In this example, the `$redact` stage checks the value of the `status` field in each document. If the `status` is "shipped" or "processing", the document is kept (`$$KEEP`). Otherwise, the document is pruned (`$$PRUNE`). - -## Code examples - -To view a code example for using the `$redact` 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('orders'); - - const result = await collection.aggregate([ - { - $redact: { - $cond: { - if: { $in: ['$status', ['shipped', 'processing']] }, - then: '$$KEEP', - else: '$$PRUNE' - } - } - } - ]).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['orders'] - - result = list(collection.aggregate([ - { - '$redact': { - '$cond': { - 'if': { '$in': ['$status', ['shipped', 'processing']] }, - 'then': '$$KEEP', - 'else': '$$PRUNE' - } - } - } - ])) - - 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) - -$range - -$reduce - -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.