AWS documentdb documentation change
Summary
Entire documentation page for the $minute aggregation operator has been removed, including all examples and code samples
Security assessment
This appears to be a routine documentation cleanup or restructuring where the $minute operator documentation was completely removed. There is no evidence in the diff of any security vulnerability, weakness, or incident being addressed. The change removes general feature documentation rather than adding or modifying security-related content. The removed content was purely about the functionality of the $minute aggregation operator with standard usage examples.
Diff
diff --git a/documentdb/latest/developerguide/minute.md b/documentdb/latest/developerguide/minute.md index 29a51c868..8b1378917 100644 --- a//documentdb/latest/developerguide/minute.md +++ b//documentdb/latest/developerguide/minute.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#minute "Open PDF") @@ -3,155 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $minute - -The `$minute` aggregation pipeline stage in Amazon DocumentDB extracts the minute value from a date or timestamp field. - -This operator is useful when you need to perform date and time-based calculations or grouping within your aggregation pipeline. - -**Parameters** - - * `expression`: The date or timestamp field from which to extract the minute value. - - - - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$minute` operator to group the documents by the minute value extracted from the timestamp field and count the number of documents in each group. - -**Create sample documents** - - - db.events.insertMany([ - { timestamp: new Date("2023-04-15T10:30:25.000Z") }, - { timestamp: new Date("2023-04-15T10:30:35.000Z") }, - { timestamp: new Date("2023-04-15T10:31:05.000Z") }, - { timestamp: new Date("2023-04-15T10:31:45.000Z") }, - { timestamp: new Date("2023-04-15T10:32:15.000Z") } - ]); - -**Query example** - - - db.events.aggregate([ - { - $group: { - _id: { - minute: { $minute: "$timestamp" } - }, - count: { $count: {} } - } - }, - { $sort: { "_id.minute": 1 } } - ]); - -**Output** - - - [ - { "_id": { "minute": 30 }, "count": 2 }, - { "_id": { "minute": 31 }, "count": 2 }, - { "_id": { "minute": 32 }, "count": 1 } - ] - -## Code examples - -To view a code example for using the `$minute` 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 collection = db.collection('events'); - - await collection.insertMany([ - { timestamp: new Date("2023-04-15T10:30:25.000Z") }, - { timestamp: new Date("2023-04-15T10:30:35.000Z") }, - { timestamp: new Date("2023-04-15T10:31:05.000Z") }, - { timestamp: new Date("2023-04-15T10:31:45.000Z") }, - { timestamp: new Date("2023-04-15T10:32:15.000Z") } - ]); - - const result = await collection.aggregate([ - { - $group: { - _id: { - minute: { $minute: "$timestamp" } - }, - count: { $count: {} } - } - }, - { $sort: { "_id.minute": 1 } } - ]).toArray(); - - console.log(result); - await client.close(); - } - - example(); - -Python - - - - from pymongo import MongoClient - from datetime import datetime - - 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['events'] - - collection.insert_many([ - {'timestamp': datetime(2023, 4, 15, 10, 30, 25)}, - {'timestamp': datetime(2023, 4, 15, 10, 30, 35)}, - {'timestamp': datetime(2023, 4, 15, 10, 31, 5)}, - {'timestamp': datetime(2023, 4, 15, 10, 31, 45)}, - {'timestamp': datetime(2023, 4, 15, 10, 32, 15)} - ]) - - result = list(collection.aggregate([ - { - '$group': { - '_id': { - 'minute': {'$minute': '$timestamp'} - }, - 'count': {'$count': {}} - } - }, - {'$sort': {'_id.minute': 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) - -$min - -$mod - -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.