AWS documentdb documentation change
Summary
Entire documentation page for the $inc operator was removed, including examples, parameters, and code samples for MongoDB Shell, Node.js, and Python.
Security assessment
This change removes general documentation about the $inc operator (increment operator) which is a standard MongoDB/Amazon DocumentDB feature. There is no evidence in the diff suggesting this removal addresses a security vulnerability, weakness, or incident. The removed content appears to be routine documentation about database functionality without any security context mentioned.
Diff
diff --git a/documentdb/latest/developerguide/inc.md b/documentdb/latest/developerguide/inc.md index f0c10e772..8b1378917 100644 --- a//documentdb/latest/developerguide/inc.md +++ b//documentdb/latest/developerguide/inc.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#inc "Open PDF") @@ -3,111 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $inc - -The `$inc` operator is used to increment the value of a field by a specified amount. It is used to update a numeric field, such as a counter or a rating, without having to retrieve the current value, calculate the new value, and then update the field. - -**Parameters** - - * `field`: The name of the field to increment. - - * `amount`: The amount by which to increment the field. This can be a positive or negative value. - - - - -## Example (MongoDB Shell) - -The following example demonstrates how to use the `$inc` operator to increment the `age` field of a document. - -**Create sample documents** - - - db.users.insertOne({_id: 123, name: "John Doe", age: 30}) - -**Query example** - - - db.users.updateOne({_id: 123}, {$inc: {age: 1}}) - -**View updated document** - - - db.users.findOne({_id: 123}) - -**Output** - - - { "_id" : 123, "name" : "John Doe", "age" : 31 } - -## Code examples - -To view a code example for using the `$inc` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function updateWithInc() { - 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('users'); - - const result = await collection.updateOne( - { _id: 123 }, - { $inc: { age: 1 } } - ); - - console.log(result); - - await client.close(); - } - - updateWithInc(); - -Python - - - - from pymongo import MongoClient - - def update_with_inc(): - 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['users'] - - result = collection.update_one( - {'_id': 123}, - {'$inc': {'age': 1}} - ) - - print(result.modified_count) - - client.close() - - update_with_inc() - - **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) - -$each - -$max - -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.