AWS documentdb documentation change
Summary
Removed entire documentation content for the $ROOT operator in Amazon DocumentDB, including examples, code samples, and usage instructions
Security assessment
This change removes documentation about a database operator ($ROOT) used in aggregation pipelines. There is no evidence in the diff that this removal addresses a security vulnerability, weakness, or incident. The removed content appears to be standard operational documentation without security implications. The change could potentially be part of a documentation reorganization or deprecation, but no security context is provided.
Diff
diff --git a/documentdb/latest/developerguide/ROOT.md b/documentdb/latest/developerguide/ROOT.md index c17848ab6..8b1378917 100644 --- a//documentdb/latest/developerguide/ROOT.md +++ b//documentdb/latest/developerguide/ROOT.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#ROOT "Open PDF") @@ -3,197 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $ROOT - -The `$ROOT` operator in Amazon DocumentDB is used to reference the entire input document within an aggregation pipeline. It allows you to access and manipulate the complete document, including all its nested fields and structures. - -**Parameters** - -None - -## Example (MongoDB Shell) - -This example demonstrates using `$ROOT` to create an audit log that captures the complete original document along with metadata about when it was processed. - -**Create sample documents** - - - db.orders.insertMany([ - { - _id: 1, - orderId: "ORD-2024-001", - customer: "María García", - email: "marí[email protected]", - items: [ - { product: "Laptop", quantity: 1, price: 1299.99 } - ], - totalAmount: 1299.99 - }, - { - _id: 2, - orderId: "ORD-2024-002", - customer: "Arnav Desai", - email: "[email protected]", - items: [ - { product: "Mouse", quantity: 2, price: 29.99 }, - { product: "Keyboard", quantity: 1, price: 89.99 } - ], - totalAmount: 149.97 - } - ]); - -**Query example** - - - db.orders.aggregate([ - { - $project: { - processedAt: new Date(), - originalDocument: "$$ROOT", - summary: { - $concat: [ - "Order ", - "$orderId", - " for ", - "$customer", - " - Total: $", - { $toString: "$totalAmount" } - ] - } - } - } - ]); - -**Output** - - - [ - { - _id: 1, - processedAt: ISODate('2025-11-24T20:43:51.492Z'), - originalDocument: { - _id: 1, - orderId: 'ORD-2024-001', - customer: 'María García', - email: 'marí[email protected]', - items: [ { product: 'Laptop', quantity: 1, price: 1299.99 } ], - totalAmount: 1299.99 - }, - summary: 'Order ORD-2024-001 for María García - Total: $1299.99' - }, - { - _id: 2, - processedAt: ISODate('2025-11-24T20:43:51.492Z'), - originalDocument: { - _id: 2, - orderId: 'ORD-2024-002', - customer: 'Arnav Desai', - email: '[email protected]', - items: [ - { product: 'Mouse', quantity: 2, price: 29.99 }, - { product: 'Keyboard', quantity: 1, price: 89.99 } - ], - totalAmount: 149.97 - }, - summary: 'Order ORD-2024-002 for Arnav Desai - Total: $149.97' - } - ] - -## Code examples - -To view a code example for using the `$ROOT` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function createAuditLog() { - 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 orders = db.collection('orders'); - - const result = await orders.aggregate([ - { - $project: { - processedAt: new Date(), - originalDocument: "$$ROOT", - summary: { - $concat: [ - "Order ", - "$orderId", - " for ", - "$customer", - " - Total: $", - { $toString: "$totalAmount" } - ] - } - } - } - ]).toArray(); - - console.log(result); - await client.close(); - } - - createAuditLog(); - -Python - - - - from pymongo import MongoClient - from datetime import datetime - - def create_audit_log(): - client = MongoClient('mongodb://username:password@docdb-cluster.cluster-123456789.us-east-1.docdb.amazonaws.com:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') - db = client['test'] - collection = db['orders'] - - result = list(collection.aggregate([ - { - '$project': { - 'processedAt': datetime.now(), - 'originalDocument': '$$ROOT', - 'summary': { - '$concat': [ - "Order ", - "$orderId", - " for ", - "$customer", - " - Total: $", - { '$toString': "$totalAmount" } - ] - } - } - } - ])) - - print(result) - client.close() - - create_audit_log() - - **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) - -$$PRUNE - -$abs - -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