AWS documentdb documentation change
Summary
Removed entire documentation content for the $set operator, including examples, code samples, and navigation elements.
Security assessment
The change removes general documentation about the $set operator functionality and code examples. There is no evidence in the diff of addressing a specific security vulnerability, weakness, or incident. The removed content appears to be standard operational documentation without security context.
Diff
diff --git a/documentdb/latest/developerguide/set-update.md b/documentdb/latest/developerguide/set-update.md index 38dc6ab16..8b1378917 100644 --- a//documentdb/latest/developerguide/set-update.md +++ b//documentdb/latest/developerguide/set-update.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#set-update "Open PDF") @@ -3,135 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $set - -The `$set` operator in Amazon DocumentDB is used to update the value of a specified field in a document. This operator allows you to add new fields or modify existing ones within a document. It is a fundamental update operator in the MongoDB Java driver, which is compatible with Amazon DocumentDB. - -**Parameters** - - * `field`: The field to update. - - * `value`: The new value for the field. - - - - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$set` operator to update the `Item` field in a document. - -**Create sample documents** - - - db.example.insert([ - { - "Item": "Pen", - "Colors": ["Red", "Green", "Blue", "Black"], - "Inventory": { - "OnHand": 244, - "MinOnHand": 72 - } - }, - { - "Item": "Poster Paint", - "Colors": ["Red", "Green", "Blue", "White"], - "Inventory": { - "OnHand": 120, - "MinOnHand": 36 - } - } - ]) - -**Query example** - - - db.example.update( - { "Item": "Pen" }, - { $set: { "Item": "Gel Pen" } } - ) - -**Output** - - - { - "Item": "Gel Pen", - "Colors": ["Red", "Green", "Blue", "Black"], - "Inventory": { - "OnHand": 244, - "MinOnHand": 72 - } - } - -## Code examples - -To view a code example for using the `$set` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function updateDocument() { - 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'); - - await collection.updateOne( - { "Item": "Pen" }, - { $set: { "Item": "Gel Pen" } } - ); - - const updatedDocument = await collection.findOne({ "Item": "Gel Pen" }); - console.log(updatedDocument); - - await client.close(); - } - - updateDocument(); - -Python - - - - from pymongo import MongoClient - - def update_document(): - 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 - - collection.update_one( - {"Item": "Pen"}, - {"$set": {"Item": "Gel Pen"}} - ) - - updated_document = collection.find_one({"Item": "Gel Pen"}) - print(updated_document) - - client.close() - - update_document() - - **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) - -$rename - -$setOnInsert - -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.