AWS documentdb documentation change
Summary
Entire documentation page for the $toDate aggregation operator has been removed, including all examples, parameters, and code samples in MongoDB Shell, Node.js, and Python.
Security assessment
This change removes documentation for a specific MongoDB aggregation operator ($toDate) but shows no evidence of addressing a security vulnerability, weakness, or incident. The removal appears to be part of content reorganization or deprecation of documentation for this operator. No security context is provided in the diff.
Diff
diff --git a/documentdb/latest/developerguide/toDate.md b/documentdb/latest/developerguide/toDate.md index 10ec240e9..8b1378917 100644 --- a//documentdb/latest/developerguide/toDate.md +++ b//documentdb/latest/developerguide/toDate.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#toDate "Open PDF") @@ -3,143 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $toDate - -New from version 4.0 - -The `$toDate` aggregation operator in Amazon DocumentDB is used to convert a date or date and time string to a BSON Date type. This is the inverse operation of the `$dateToString` operator. - -**Parameters** - - * `dateString`: A string representation of a date or date and time to be converted to a BSON Date type. - - * `format`: (optional) A string that specifies the format of the `dateString`. If not provided, the operator will attempt to parse the `dateString` in various standard date and time formats. - - * `timezone`: (optional) A string representing the time zone to use for the conversion. If not provided, the local time zone is used. - - - - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$toDate` operator to convert a date string to a BSON Date type. - -**Create sample documents** - - - db.events.insertMany([ - { _id: 1, eventName: "Mission Start", eventTime: "2023-04-15T10:30:00Z" }, - { _id: 2, eventName: "Checkpoint Reached", eventTime: "2023-04-15T11:15:00Z" }, - { _id: 3, eventName: "Mission End", eventTime: "2023-04-15T12:00:00Z" } - ]); - -**Query example** - - - db.events.aggregate([ - { - $project: { - eventName: 1, - eventTimeDate: { $toDate: "$eventTime" } - } - } - ]); - -**Output** - - - [ - { - "_id": 1, - "eventName": "Mission Start", - "eventTimeDate": ISODate("2023-04-15T10:30:00Z") - }, - { - "_id": 2, - "eventName": "Checkpoint Reached", - "eventTimeDate": ISODate("2023-04-15T11:15:00Z") - }, - { - "_id": 3, - "eventName": "Mission End", - "eventTimeDate": ISODate("2023-04-15T12:00:00Z") - } - ] - -## Code examples - -To view a code example for using the `$toDate` 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'); - - const result = await collection.aggregate([ - { - $project: { - eventName: 1, - eventTimeDate: { $toDate: '$eventTime' } - } - } - ]).toArray(); - - console.log(result); - 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['events'] - - result = list(collection.aggregate([ - { - '$project': { - 'eventName': 1, - 'eventTimeDate': { '$toDate': '$eventTime' } - } - } - ])) - - 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) - -$toBool - -$toDecimal - -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.