AWS documentdb documentation change
Summary
Entire documentation page for the $second operator was removed, including all content, examples, and code samples
Security assessment
This change removes documentation for the $second operator but provides no evidence of security vulnerability remediation. The removal could be due to feature deprecation, documentation restructuring, or other non-security reasons. No security warnings, vulnerabilities, or security-related content is mentioned in the removed text.
Diff
diff --git a/documentdb/latest/developerguide/second.md b/documentdb/latest/developerguide/second.md index e293fdbc6..8b1378917 100644 --- a//documentdb/latest/developerguide/second.md +++ b//documentdb/latest/developerguide/second.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#second "Open PDF") @@ -3,104 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $second - -The `$second` operator in Amazon DocumentDB extracts the seconds component from a date or timestamp. It is used to retrieve the seconds value from a date or timestamp field. - -**Parameters** - - * `expression`: The date or timestamp field to extract the seconds value from. This expression can be a field path or any valid expression that resolves to a date or timestamp. - - - - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$second` operator to extract the seconds component from a date field. - -**Create sample documents** - - - db.users.insertMany([ - { name: "John", dob: new Date("1990-05-15T12:30:45Z") }, - { name: "Jane", dob: new Date("1985-09-20T23:59:59Z") }, - { name: "Bob", dob: new Date("2000-01-01T00:00:00Z") } - ]); - -**Query example** - - - db.users.aggregate([{ $project: { name: 1, dobSeconds: { $second: "$dob" } } }]) - -**Output** - - - [ - { "_id" : ObjectId("6089a9c306a829d1f8b456a1"), "name" : "John", "dobSeconds" : 45 }, - { "_id" : ObjectId("6089a9c306a829d1f8b456a2"), "name" : "Jane", "dobSeconds" : 59 }, - { "_id" : ObjectId("6089a9c306a829d1f8b456a3"), "name" : "Bob", "dobSeconds" : 0 } - ] - -## Code examples - -To view a code example for using the `$second` 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 users = db.collection('users'); - - const result = await users.aggregate([{ $project: { name: 1, dobSeconds: { $second: '$dob' } } }]).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'] - users = db['users'] - - result = list(users.aggregate([{'$project': {'name': 1, 'dobSeconds': {'$second': '$dob'}}}])) - 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) - -$search - -$set - -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.