AWS documentdb documentation change
Summary
Entire documentation page for the $bucket aggregation stage has been removed, including all content, examples, and code samples
Security assessment
This change removes documentation content entirely without any mention of security vulnerabilities, patches, or security-related issues. The removal appears to be a content reorganization or deprecation of documentation for the $bucket aggregation stage feature. There is no evidence in the diff of security fixes, vulnerability disclosures, or security feature additions.
Diff
diff --git a/documentdb/latest/developerguide/bucket.md b/documentdb/latest/developerguide/bucket.md index e51a2b58f..8b1378917 100644 --- a//documentdb/latest/developerguide/bucket.md +++ b//documentdb/latest/developerguide/bucket.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#bucket "Open PDF") @@ -3,161 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $bucket - -New from version 8.0 - -Not supported by Elastic cluster. - -The `$bucket` aggregation stage in Amazon DocumentDB allows you to group input documents into buckets based on a specified expression and bucket boundaries. This can be useful for analyzing data that falls within certain value ranges or categories. - -**Parameters** - - * `groupBy` (required): The expression that specifies the value to group by. - - * `boundaries` (required): An array of double values that define the bucket boundaries. Documents are assigned to buckets based on the `groupBy` expression value falling within the specified boundaries. - - * `default` (optional): A literal value that is output for documents whose `groupBy` expression value does not fall into any of the specified boundaries. - - * `output` (optional): An object that specifies the information to output for each bucket. You can use accumulator operators like `$sum`, `$avg`, `$min`, and `$max` to compute aggregations for each bucket. - - - - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$bucket` stage to group sales data by price range. - -**Create sample documents** - - - db.sales.insertMany([ - { item: "abc", price: 10, quantity: 2, date: new Date("2020-09-01") }, - { item: "def", price: 20, quantity: 1, date: new Date("2020-10-01") }, - { item: "ghi", price: 5, quantity: 3, date: new Date("2020-11-01") }, - { item: "jkl", price: 15, quantity: 2, date: new Date("2020-12-01") }, - { item: "mno", price: 25, quantity: 1, date: new Date("2021-01-01") } - ]); - -**Query example** - - - db.sales.aggregate([ - { - $bucket: { - groupBy: "$price", - boundaries: [0, 10, 20, 30], - default: "Other", - output: { - "count": { $sum: 1 }, - "totalQuantity": { $sum: "$quantity" } - } - } - }, - { - $sort: { _id: 1 } - } - ]) - -**Output** - - - [ - { _id: 0, count: 1, totalQuantity: 3 }, - { _id: 10, count: 2, totalQuantity: 4 }, - { _id: 20, count: 2, totalQuantity: 2 } - ] - -## Code examples - -To view a code example for using the `$bucket` 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 sales = db.collection('sales'); - - const result = await sales.aggregate([ - { - $bucket: { - groupBy: "$price", - boundaries: [0, 10, 20, 30], - default: "Other", - output: { - "count": { $sum: 1 }, - "totalQuantity": { $sum: "$quantity" } - } - } - }, - { - $sort: { _id: 1 } - } - ]).toArray(); - - console.log(result); - client.close(); - } - - example(); - -Python - - - - from pymongo import MongoClient - - def example(): - client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&lsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') - db = client['test'] - sales = db['sales'] - - result = list(sales.aggregate([ - { - '$bucket': { - 'groupBy': '$price', - 'boundaries': [0, 10, 20, 30], - 'default': 'Other', - 'output': { - 'count': {'$sum': 1}, - 'totalQuantity': {'$sum': '$quantity'} - } - } - }, - { - "$sort": { "_id": 1 } - } - ])) - - 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) - -$avg - -$ceil - -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.