AWS documentdb documentation change
Summary
Entire documentation page for the $in aggregation operator was removed, including examples in MongoDB Shell, Node.js, and Python
Security assessment
This change removes documentation about the $in aggregation operator functionality. There is no evidence in the diff that this removal addresses a security vulnerability, weakness, or incident. The removed content appears to be standard operator documentation with code examples, and no security-related content is mentioned in the removed text. The change appears to be routine documentation maintenance or restructuring.
Diff
diff --git a/documentdb/latest/developerguide/in-aggregation.md b/documentdb/latest/developerguide/in-aggregation.md index 949b6bd1d..8b1378917 100644 --- a//documentdb/latest/developerguide/in-aggregation.md +++ b//documentdb/latest/developerguide/in-aggregation.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#in-aggregation "Open PDF") @@ -3,127 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $in - -The `$in` aggregation operator checks if a specified value exists within an array. It returns `true` if the value is found in the array, and `false` otherwise. - -**Parameters** - - * `value`: The value to search for. - - * `array`: The array to search within. - - - - -## Example (MongoDB Shell) - -The following example demonstrates using the `$in` operator to check if a specific skill exists in each employee's skill set. - -**Create sample documents** - - - db.employees.insertMany([ - { _id: 1, name: "Sarah", skills: ["Python", "JavaScript", "SQL"] }, - { _id: 2, name: "Mike", skills: ["Java", "C++", "Go"] }, - { _id: 3, name: "Emma", skills: ["Python", "Ruby", "Rust"] } - ]); - -**Query example** - - - db.employees.aggregate([ - { - $project: { - name: 1, - hasPython: { $in: ["Python", "$skills"] } - } - } - ]); - -**Output** - - - [ - { _id: 1, name: 'Sarah', hasPython: true }, - { _id: 2, name: 'Mike', hasPython: false }, - { _id: 3, name: 'Emma', hasPython: true } - ] - -## Code examples - -To view a code example for using the `$in` aggregation operator, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function example() { - 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('employees'); - - const result = await collection.aggregate([ - { - $project: { - name: 1, - hasPython: { $in: ["Python", "$skills"] } - } - } - ]).toArray(); - - console.log(result); - await client.close(); - } - - example(); - -Python - - - - from pymongo import MongoClient - - def example(): - 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['employees'] - - result = list(collection.aggregate([ - { - '$project': { - 'name': 1, - 'hasPython': { '$in': ['Python', '$skills'] } - } - } - ])) - - print(result) - client.close() - - example() - - **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) - -$ifNull - -$indexOfArray - -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.