AWS documentdb documentation change
Summary
Entire documentation page for the $unset operator in Amazon DocumentDB has been removed, including examples in MongoDB Shell, Node.js, and Python, as well as connection string examples with authentication parameters.
Security assessment
This change removes documentation about the $unset operator but does not indicate any security vulnerability, weakness, or incident. The removal includes connection strings with authentication placeholders, but this appears to be part of general documentation restructuring rather than addressing a specific security issue. There is no evidence of security remediation or vulnerability disclosure in the diff.
Diff
diff --git a/documentdb/latest/developerguide/unset-update.md b/documentdb/latest/developerguide/unset-update.md index 5b91d8653..8b1378917 100644 --- a//documentdb/latest/developerguide/unset-update.md +++ b//documentdb/latest/developerguide/unset-update.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#unset-update "Open PDF") @@ -3,124 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $unset - -The `$unset` operator in Amazon DocumentDB is used to remove a specified field from a document. When a field is removed using `$unset`, the field is deleted from the document, and the document size is reduced accordingly. This can be useful when you want to remove unnecessary data from your documents. - -**Parameters** - - * `field`: The field to remove from the document. This can be a single field or a dotted path to a nested field. - - - - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$unset` operator to remove the `Words` field from a document in the `example` collection. - -**Create sample documents** - - - db.example.insert({ - "DocName": "Document 1", - "Date": { - "Month": 4, - "Day": 18, - "Year": 1987, - "DoW": "Saturday" - }, - "Words": 2482 - }) - -**Query example** - - - db.example.update( - { "DocName" : "Document 1" }, - { $unset: { Words:1 } } - ) - -**Output** - - - { - "DocName": "Document 1", - "Date": { - "Month": 4, - "Day": 18, - "Year": 1987, - "DoW": "Saturday" - } - } - -In this example, the `$unset` operator is used to remove the `Words` field from the document with `DocName` equal to "Document 1". The resulting document no longer contains the `Words` field. - -## Code examples - -To view a code example for using the `$unset` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function removeField() { - 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('example'); - - const result = await collection.updateOne( - { "DocName": "Document 1" }, - { $unset: { "Words": 1 } } - ); - - console.log(`Modified ${result.modifiedCount} document(s)`); - client.close(); - } - - removeField(); - -Python - - - - from pymongo import MongoClient - - def remove_field(): - 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['example'] - - result = collection.update_one( - {"DocName": "Document 1"}, - {"$unset": {"Words": 1}} - ) - - print(f"Modified {result.modified_count} document(s)") - client.close() - - remove_field() - - **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) - -$sort - -Generative AI - -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.