AWS documentdb documentation change
Summary
Entire documentation page for the $mod operator was removed, including all content, examples, and code samples
Security assessment
This change removes documentation for a mathematical operator ($mod) in Amazon DocumentDB. There is no evidence in the diff that this removal is related to a security vulnerability or incident. The removed content appears to be standard documentation for a database operator with example usage, not security-related content. The change appears to be routine documentation maintenance or restructuring.
Diff
diff --git a/documentdb/latest/developerguide/mod.md b/documentdb/latest/developerguide/mod.md index 440bf9ee2..8b1378917 100644 --- a//documentdb/latest/developerguide/mod.md +++ b//documentdb/latest/developerguide/mod.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#mod "Open PDF") @@ -3,123 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $mod - -The `$mod` operator is an arithmetic operator that performs a modulo operation on a number. It returns the remainder of dividing one number by another. This operator is commonly used to determine if a number is odd or even, or to distribute items into a finite number of groups. - -**Parameters** - - * `expression1`: The dividend expression. - - * `expression2`: The divisor expression. - - - - -## Example (MongoDB Shell) - -This example demonstrates how to use the `$mod` operator to determine the number of leftover widgets when shipping in packages of 100. - -**Create sample documents** - - - db.widgets.insertMany([ - { "_id" : 1, "widget" : "A", "count" : 80372 }, - { "_id" : 2, "widget" : "B", "count" : 409282 }, - { "_id" : 3, "widget" : "C", "count" : 60739 } - ]) - -**Query example** - - - db.widgets.aggregate([ - { $addFields: { leftOver: { $mod: [ "$count", 100 ] } } } - ]) - -**Output** - - - [ - { "_id" : 1, "widget" : "A", "count" : 80372, "leftOver" : 72 }, - { "_id" : 2, "widget" : "B", "count" : 409282, "leftOver" : 82 }, - { "_id" : 3, "widget" : "C", "count" : 60739, "leftOver" : 39 } - ] - -The output shows the remainder of the `count` divided by 100 for each document, which represents the number of leftover widgets when shipping in packages of 100. - -## Code examples - -To view a code example for using the `$mod` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function main() { - 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 widgets = db.collection('widgets'); - - await widgets.insertMany([ - { "_id" : 1, "widget" : "A", "count" : 80372 }, - { "_id" : 2, "widget" : "B", "count" : 409282 }, - { "_id" : 3, "widget" : "C", "count" : 60739 } - ]); - - const result = await widgets.aggregate([ - { $addFields: { leftOver: { $mod: [ "$count", 100 ] } } } - ]).toArray(); - - console.log(result); - client.close(); - } - - main(); - -Python - - - - from pymongo import MongoClient - - client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') - db = client['test'] - widgets = db['widgets'] - - widgets.insert_many([ - { "_id" : 1, "widget" : "A", "count" : 80372 }, - { "_id" : 2, "widget" : "B", "count" : 409282 }, - { "_id" : 3, "widget" : "C", "count" : 60739 } - ]) - - result = list(widgets.aggregate([ - { "$addFields": { "leftOver": { "$mod": [ "$count", 100 ] } } } - ])) - - print(result) - client.close() - - **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) - -$minute - -$month - -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.