AWS documentdb documentation change
Summary
Entire documentation page for the $currentDate operator has been removed, including examples and code samples
Security assessment
This change removes documentation content entirely but shows no evidence of addressing a security vulnerability. The removed content appears to be standard documentation for the $currentDate operator with example code. There are no security warnings, vulnerability disclosures, or security-related content being added or modified.
Diff
diff --git a/documentdb/latest/developerguide/currentDate.md b/documentdb/latest/developerguide/currentDate.md index 875995632..8b1378917 100644 --- a//documentdb/latest/developerguide/currentDate.md +++ b//documentdb/latest/developerguide/currentDate.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#currentDate "Open PDF") @@ -3,120 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $currentDate - -The `$currentDate` operator is used to set the value of a field to the current date and time. This operator is useful for automatically updating a field with the current timestamp when a document is inserted or updated. - -**Parameters** - - * `field`: The field to update with the current date and time. - - * `type`: (optional) Specifies the BSON type to use for the current date. Can be either `date` or `timestamp`. - - - - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$currentDate` operator to set the `lastModified` field to the current date and time when a new document is inserted. - -**Create sample documents** - - - db.users.insert({ - name: "John Doe", - email: "[email protected]" - }) - -**Query example** - - - db.users.updateOne( - { name: "John Doe" }, - { $currentDate: { lastModified: true } } - ) - -**View updated document** - - - db.users.findOne({ name: "John Doe" }) - -**Output** - - - { - _id: ObjectId('...'), - name: 'John Doe', - email: '[email protected]', - lastModified: ISODate('2025-10-25T22:50:29.963Z') - } - -## Code examples - -To view a code example for using the `$currentDate` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function updateUserWithCurrentDate() { - 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 users = db.collection('users'); - - await users.updateOne( - { name: 'John Doe' }, - { $currentDate: { lastModified: true } } - ); - - console.log('User updated with current date'); - client.close(); - } - - updateUserWithCurrentDate(); - -Python - - - - from pymongo import MongoClient - - def update_user_with_current_date(): - client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') - db = client['test'] - users = db.users - - result = users.update_one( - {'name': 'John Doe'}, - {'$currentDate': {'lastModified': True}} - ) - - print('User updated with current date') - client.close() - - update_user_with_current_date() - - **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) - -$bit - -$each - -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.