AWS documentdb documentation change
Summary
Entire documentation page for the $indexStats aggregation stage has been removed, including all examples, code samples, and explanatory content.
Security assessment
The change removes an entire documentation page without any mention of security vulnerabilities, weaknesses, or incidents. This appears to be a routine documentation restructuring or removal, possibly due to deprecation or relocation of content. There is no evidence in the diff that this change addresses a specific security issue.
Diff
diff --git a/documentdb/latest/developerguide/indexStats.md b/documentdb/latest/developerguide/indexStats.md index c32df5b1d..8b1378917 100644 --- a//documentdb/latest/developerguide/indexStats.md +++ b//documentdb/latest/developerguide/indexStats.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#indexStats "Open PDF") @@ -3,124 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $indexStats - -The `$indexStats` aggregation stage in Amazon DocumentDB provides insight into the usage of indexes within a collection. This operator allows you to monitor the access patterns of your indexes, which can help you make informed decisions about index management and optimization. - -**Parameters** - -None - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$indexStats` operator to analyze the index usage in an Amazon DocumentDB collection. - -**Create sample documents** - - - db.grocery.insertMany([ - { _id: 1, product: "milk", quantity: 10 }, - { _id: 2, product: "eggs", quantity: 20 }, - { _id: 3, product: "bread", quantity: 5 }, - { _id: 4, product: "cheese", quantity: 15 }, - { _id: 5, product: "apple", quantity: 8 } - ]); - -**Query example** - - - db.grocery.aggregate([ - { $indexStats: {} } - ]); - -**Output** - - - [ - { - "name": "_id_", - "key": { - "_id": 1 - }, - "host": "docdb-cluster-1.cluster-123456789.us-west-2.docdb.amazonaws.com", - "accesses": { - "ops": NumberLong(5), - "since": ISODate("2023-04-06T12:34:56.789Z") - } - }, - { - "name": "product_1", - "key": { - "product": 1 - }, - "host": "docdb-cluster-1.cluster-123456789.us-west-2.docdb.amazonaws.com", - "accesses": { - "ops": NumberLong(10), - "since": ISODate("2023-04-06T12:34:56.789Z") - } - } - ] - -In this example, the `$indexStats` operator shows that the `_id_` index has been accessed 5 times, and the `product_1` index has been accessed 10 times since the last reset or server reboot. - -## Code examples - -To view a code example for using the `$indexStats` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function indexStats() { - 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 result = await db.collection('grocery').aggregate([ - { $indexStats: {} } - ]).toArray(); - console.log(result); - await client.close(); - } - - indexStats(); - -Python - - - - from pymongo import MongoClient - - def index_stats(): - client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') - db = client['test'] - result = list(db.grocery.aggregate([ - { '$indexStats': {} } - ])) - print(result) - client.close() - - index_stats() - - **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) - -$indexOfCP - -$isArray - -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.