AWS documentdb documentation change
Summary
Entire documentation page for the $reverseArray operator was removed, including all content, examples, and code samples
Security assessment
This change removes documentation for a specific MongoDB operator ($reverseArray) but provides no evidence of security vulnerability or security-related context. The removal appears to be part of routine documentation cleanup or restructuring, not related to addressing a security issue. No security warnings, vulnerabilities, or security-related content was present in the removed material.
Diff
diff --git a/documentdb/latest/developerguide/reverseArray.md b/documentdb/latest/developerguide/reverseArray.md index 22e4469b4..8b1378917 100644 --- a//documentdb/latest/developerguide/reverseArray.md +++ b//documentdb/latest/developerguide/reverseArray.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#reverseArray "Open PDF") @@ -3,135 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $reverseArray - -The `$reverseArray` operator in Amazon DocumentDB is used to reverse the elements of an array in the specified order. This operator is useful when you need to reorder the elements of an array in the reverse direction. - -**Parameters** - - * `expression`: The array expression to reverse. - - - - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$reverseArray` operator to reverse the order of elements in an array. - -**Create sample documents** - - - db.miles.insertMany([ - { "_id" : 1, "member_since" : ISODate("1987-01-01T00:00:00Z"), "credit_card" : false, "flight_miles" : [ 1205, 2560, 880 ]}, - { "_id" : 2, "member_since" : ISODate("1982-01-01T00:00:00Z"), "credit_card" : true, "flight_miles" : [ 1205, 2560, 890, 2780]}, - { "_id" : 3, "member_since" : ISODate("1999-01-01T00:00:00Z"), "credit_card" : true, "flight_miles" : [ 1205, 880]} - ]); - -**Query example** - - - db.miles.aggregate([ - { - $project: { - _id: 1, - member_since: 1, - credit_card: 1, - reversed_flight_miles: { $reverseArray: "$flight_miles" } - } - } - ]); - -**Output** - - - { "_id" : 1, "member_since" : ISODate("1987-01-01T00:00:00Z"), "credit_card" : false, "reversed_flight_miles" : [ 880, 2560, 1205 ] } - { "_id" : 2, "member_since" : ISODate("1982-01-01T00:00:00Z"), "credit_card" : true, "reversed_flight_miles" : [ 2780, 890, 2560, 1205 ] } - { "_id" : 3, "member_since" : ISODate("1999-01-01T00:00:00Z"), "credit_card" : true, "reversed_flight_miles" : [ 880, 1205 ] } - -In this example, the `$reverseArray` operator is used to reverse the order of the `flight_miles` array. The resulting `reversed_flight_miles` field in the output shows the elements of the array in the reversed order. - -## Code examples - -To view a code example for using the `$reverseArray` command, choose the tab for the language that you want to use: - -Node.js - - -Here's an example of using the `$reverseArray` operator in a Node.js application: - - - const { MongoClient } = require('mongodb'); - - async function reverseArray() { - 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('miles'); - - const result = await collection.aggregate([ - { - $project: { - _id: 1, - member_since: 1, - credit_card: 1, - reversed_flight_miles: { $reverseArray: '$flight_miles' } - } - } - ]).toArray(); - - console.log(result); - client.close(); - } - - reverseArray(); - -Python - - -Here's an example of using the `$reverseArray` operator in a Python application: - - - from pymongo import MongoClient - - def reverse_array(): - 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.miles - - result = list(collection.aggregate([ - { - '$project': { - '_id': 1, - 'member_since': 1, - 'credit_card': 1, - 'reversed_flight_miles': { '$reverseArray': '$flight_miles' } - } - } - ])) - - print(result) - client.close() - - reverse_array() - - **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) - -$replaceWith - -$rtrim - -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.