AWS documentdb documentation change
Summary
Entire documentation page for the $mul operator in Amazon DocumentDB has been removed, including all examples and code samples
Security assessment
This change removes documentation for the $mul operator but does not provide any evidence of addressing a security vulnerability. The removal appears to be a documentation restructuring or deprecation of content rather than a security fix. No security warnings, CVEs, or vulnerability mentions are present in the removed content.
Diff
diff --git a/documentdb/latest/developerguide/mul.md b/documentdb/latest/developerguide/mul.md index dfef0639b..8b1378917 100644 --- a//documentdb/latest/developerguide/mul.md +++ b//documentdb/latest/developerguide/mul.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#mul "Open PDF") @@ -3,122 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $mul - -The `$mul` operator in Amazon DocumentDB is used to multiply the value of a field by a specified number. This can be useful for updating multiple documents atomically and consistently, such as updating flight miles based on a credit card status. - -**Parameters** - - * `field`: The field to be multiplied. - - * `multiplier`: The number to multiply the field value by. - - - - -## Example (MongoDB Shell) - -This example demonstrates how to use the `$mul` operator to double the `flight_miles` value for all documents where the `credit_card` field is `true`. - -**Create sample documents** - - - db.miles.insertMany([ - { "_id": 1, "member_since": new Date("1987-01-01"), "credit_card": false, "flight_miles": [1205, 2560, 880] }, - { "_id": 2, "member_since": new Date("1982-01-01"), "credit_card": true, "flight_miles": [2410, 5120, 1780, 5560] }, - { "_id": 3, "member_since": new Date("1999-01-01"), "credit_card": true, "flight_miles": [2410, 1760] } - ]); - -**Query example** - - - db.miles.update( - { "credit_card": { "$eq": true } }, - { "$mul": { "flight_miles.$[]": NumberInt(2) } }, - { "multi": true } - ); - -**Output** - - - { "_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" : [ 4820, 10240, 3560, 11120 ] } - { "_id" : 3, "member_since" : ISODate("1999-01-01T00:00:00Z"), "credit_card" : true, "flight_miles" : [ 4820, 3520 ] } - -For the customers that have a credit card, their flight miles have been doubled. - -The `$[]` positional array operator is used to apply the `$mul` operation to each element in the `flight_miles` array. - -## Code examples - -To view a code example for using the `$mul` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function updateFlightMiles() { - 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'); - - await collection.updateMany( - { credit_card: true }, - { $mul: { 'flight_miles.$[]': 2 } } - ); - - const documents = await collection.find().toArray(); - console.log(documents); - - await client.close(); - } - - updateFlightMiles(); - -Python - - - - from pymongo import MongoClient - - def update_flight_miles(): - 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 - - collection.update_many( - {'credit_card': True}, - {'$mul': {'flight_miles.$[]': 2}} - ) - - documents = list(collection.find()) - print(documents) - - client.close() - - update_flight_miles() - - **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) - -$min - -$pop - -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.