AWS documentdb documentation change
Summary
Removed entire documentation page for the $out operator in Amazon DocumentDB, including examples and code snippets.
Security assessment
The change removes documentation about the $out aggregation operator. There is no mention of security vulnerabilities, weaknesses, or incidents in the removed content. This appears to be routine documentation restructuring or removal of outdated content without security implications.
Diff
diff --git a/documentdb/latest/developerguide/out.md b/documentdb/latest/developerguide/out.md index 5412e2e10..8b1378917 100644 --- a//documentdb/latest/developerguide/out.md +++ b//documentdb/latest/developerguide/out.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#out "Open PDF") @@ -3,134 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $out - -The `$out` operator in Amazon DocumentDB is used to write the result of an aggregation pipeline to a specified collection. - -`$out` should be the last stage in the pipeline. - -**Parameters** - - * `output_collection`: The name of the output collection to write the aggregation results to. - - - - -**Note** : If the collection already exists, it will be replaced with the results of the aggregation stage. - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$out` operator in Amazon DocumentDB to write the results of an aggregation pipeline to a new collection. - -**Create sample documents** - - - db.products.insertMany([ - { _id: 1, name: "Wireless Headphones", category: "Electronics", price: 100.0 }, - { _id: 2, name: "Smartphone", category: "Electronics", price: 200.0 }, - { _id: 3, name: "JavaScript Guide", category: "Books", price: 50.0 }, - { _id: 4, name: "Database Design Handbook", category: "Books", price: 75.0 } - ]); - -**Query example** - - - db.products.aggregate([ - { $group: { _id: "$category", totalPrice: { $sum: "$price" } } }, - { $out: "product_categories" } - ]) - -**Output** - -None (the results are written to the output collection). - -The aggregation pipeline groups the products by category and calculates the total price of the items for each category. The `$out` operator writes the results to a new collection named "product_categories". - -**To view the results in the output collection:** - - - db.product_categories.find() - [ - { "_id" : "Books", "totalPrice" : 125 }, - { "_id" : "Electronics", "totalPrice" : 300 } - ] - -## Code examples - -To view a code example for using the `$out` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function demo_out_operator() { - 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 products = db.collection('products'); - - // Execute aggregation with $out - results are stored in 'product_categories' collection - await products.aggregate([ - { $group: { _id: "$category", totalPrice: { $sum: "$price" } } }, - { $out: "product_categories" } - ]).toArray(); - - // Retrieve the results from the output collection (limited to 20 records) - const productCategories = db.collection('product_categories'); - const results = await productCategories.find({}).limit(20).toArray(); - - console.log('Results stored in product_categories collection:', results); - await client.close(); - } - - demo_out_operator(); - -Python - - - - from pymongo import MongoClient - - def demo_out_operator(): - client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') - db = client['test'] - products = db['products'] - - # Execute aggregation with $out - results are stored in 'product_categories' collection - list(products.aggregate([ - { '$group': { '_id': '$category', 'totalPrice': { '$sum': '$price' } } }, - { '$out': 'product_categories' } - ])) - - # Retrieve the results from the output collection (limited to 20 records) - product_categories = db['product_categories'] - results = list(product_categories.find({}).limit(20)) - - print('Results stored in product_categories collection:', results) - client.close() - - demo_out_operator() - - **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) - -$or - -$pow - -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.