AWS documentdb documentation change
Summary
Removed entire documentation page for $$DESCEND operator including examples and code samples
Security assessment
This change removes documentation content entirely, which could be part of documentation reorganization or deprecation. There's no evidence this addresses a security vulnerability or adds security documentation.
Diff
diff --git a/documentdb/latest/developerguide/DESCEND.md b/documentdb/latest/developerguide/DESCEND.md index 76270e694..8b1378917 100644 --- a//documentdb/latest/developerguide/DESCEND.md +++ b//documentdb/latest/developerguide/DESCEND.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#DESCEND "Open PDF") @@ -3,129 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $$DESCEND - -The `$$DESCEND` operator in Amazon DocumentDB is a special positional array operator used within the `$redact` pipeline stage. It instructs the aggregation pipeline to descend into the current document and process all fields, regardless of their nesting level. - -When the `$redact` stage encounters the `$$DESCEND` operator, it will keep all the fields in the current document visible and process them further down the pipeline. This is useful when you want to selectively redact or prune certain fields based on a condition, while retaining the structure of the document. - -**Parameters** - -None. - -## Example (MongoDB Shell) - -In this example, we'll use the `$redact` stage with the `$$DESCEND` operator to selectively display documents where the `code` field is equal to "Reg". - -**Create sample documents** - - - db.patient.insertMany([ - { "_id": 1, "code": "Emp", "patient": "John Doe", "DOB": "1/1/1980", "Hospital": "Main" }, - { "_id": 2, "code": "Reg", "patient": "Jane Doe", "DOB": "3/27/1989", "Hospital": "Cherry Hill" }, - { "_id": 3, "code": "Emp", "patient": "Bob Smith", "DOB": "6/15/1975", "Hospital": "Downtown" } - ]); - -**Query example** - - - db.patient.aggregate([ - { $redact: { - $cond: { - if: { $eq: ["Reg", "$code"] }, - then: "$$DESCEND", - else: "$$PRUNE" - } - }} - ]); - -**Output** - - - { - "_id": 2, - "code": "Reg", - "patient": "Jane Doe", - "DOB": "3/27/1989", - "Hospital": "Cherry Hill" - } - -## Code examples - -To view a code example for using the `$$DESCEND` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function redactPatients() { - 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('patient'); - - const result = await collection.aggregate([ - { $redact: { - $cond: { - if: { $eq: ["Reg", "$code"] }, - then: "$$DESCEND", - else: "$$PRUNE" - } - }} - ]).toArray(); - - console.log(result); - client.close(); - } - - redactPatients(); - -Python - - - - from pymongo import MongoClient - - def redact_patients(): - 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.patient - - result = list(collection.aggregate([ - { "$redact": { - "$cond": { - "if": { "$eq": ["Reg", "$code"] }, - "then": "$$DESCEND", - "else": "$$PRUNE" - } - }} - ])) - - print(result) - client.close() - - redact_patients() - - **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) - -Aggregation pipeline operators - -$$KEEP - -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.