AWS documentdb documentation change
Summary
Entire documentation page for the $push aggregation operator has been removed, including all examples and code samples.
Security assessment
The change removes general documentation about the $push aggregation operator without any mention of security vulnerabilities, weaknesses, or incidents. This appears to be routine documentation cleanup or restructuring rather than addressing a security issue.
Diff
diff --git a/documentdb/latest/developerguide/push-aggregation.md b/documentdb/latest/developerguide/push-aggregation.md index 7edecfb52..8b1378917 100644 --- a//documentdb/latest/developerguide/push-aggregation.md +++ b//documentdb/latest/developerguide/push-aggregation.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#push-aggregation "Open PDF") @@ -3,126 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $push - -The `$push` aggregation operator returns an array of all values from a specified expression for each group. It is typically used within the `$group` stage to accumulate values into an array. - -**Parameters** - - * `expression`: The expression to evaluate for each document in the group. - - - - -## Example (MongoDB Shell) - -The following example demonstrates using the `$push` operator to collect all product names for each category. - -**Create sample documents** - - - db.sales.insertMany([ - { _id: 1, category: "Electronics", product: "Laptop", amount: 1200 }, - { _id: 2, category: "Electronics", product: "Mouse", amount: 25 }, - { _id: 3, category: "Furniture", product: "Desk", amount: 350 }, - { _id: 4, category: "Furniture", product: "Chair", amount: 150 }, - { _id: 5, category: "Electronics", product: "Keyboard", amount: 75 } - ]); - -**Query example** - - - db.sales.aggregate([ - { - $group: { - _id: "$category", - products: { $push: "$product" } - } - } - ]); - -**Output** - - - [ - { _id: 'Furniture', products: [ 'Desk', 'Chair' ] }, - { _id: 'Electronics', products: [ 'Laptop', 'Mouse', 'Keyboard' ] } - ] - -## Code examples - -To view a code example for using the `$push` aggregation operator, 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('sales'); - - const result = await collection.aggregate([ - { - $group: { - _id: "$category", - products: { $push: "$product" } - } - } - ]).toArray(); - - console.log(result); - await 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['sales'] - - result = list(collection.aggregate([ - { - '$group': { - '_id': '$category', - 'products': { '$push': '$product' } - } - } - ])) - - 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) - -$pow - -$project - -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.