AWS documentdb documentation change
Summary
Entire documentation file for the $dayOfYear operator was removed, including examples and code samples
Security assessment
This change removes documentation about a MongoDB aggregation operator ($dayOfYear) but shows no evidence of addressing a security vulnerability, weakness, or incident. The removed content appears to be standard API documentation with usage examples. There are no security-related statements, vulnerability disclosures, or security feature additions in the removed content.
Diff
diff --git a/documentdb/latest/developerguide/dayOfYear.md b/documentdb/latest/developerguide/dayOfYear.md index 0a88720cf..8b1378917 100644 --- a//documentdb/latest/developerguide/dayOfYear.md +++ b//documentdb/latest/developerguide/dayOfYear.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#dayOfYear "Open PDF") @@ -3,128 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $dayOfYear - -The `$dayOfYear` operator in Amazon DocumentDB returns the day of the year for a date as a number between 1 and 366 (365 in non-leap years). - -**Parameters** - - * `expression`: The date field or expression from which to extract the day of the year. - - - - -## Example (MongoDB Shell) - -This example demonstrates how to use the `$dayOfYear` operator to extract the day of the year from a date field in an Amazon DocumentDB collection. - -**Create sample documents** - - - db.weather.insert([ - { - "temperature" : 97.5, - "humidity": 0.60, - "date" : new Date("2023-03-15") - }, - { - "temperature" : 82.3, - "humidity": 0.75, - "date" : new Date("2023-12-31") - } - ]) - -**Query example** - - - db.weather.aggregate([ - { - $project: { - dayOfYear: { $dayOfYear: "$date" } - } - } - ]).pretty() - -**Output** - - - { "_id" : ObjectId("642b86fc7d8e07af279bbe63"), "dayOfYear" : 74 } - { "_id" : ObjectId("642b86fc7d8e07af279bbe64"), "dayOfYear" : 365 } - -## Code examples - -To view a code example for using the `$dayOfYear` 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('weather'); - - const result = await collection.aggregate([ - { - $project: { - dayOfYear: { $dayOfYear: "$date" } - } - } - ]).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['weather'] - - result = list(collection.aggregate([ - { - '$project': { - 'dayOfYear': { '$dayOfYear': '$date' } - } - } - ])) - - 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) - -$dayOfWeek - -$divide - -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.