AWS Security ChangesHomeSearch

AWS documentdb documentation change

Service: documentdb · 2026-03-28 · Documentation low

File: documentdb/latest/developerguide/filter.md

Summary

Entire documentation page for the $filter operator in Amazon DocumentDB has been removed, including all examples, code samples, and explanations

Security assessment

This change removes an entire documentation page about the $filter operator functionality. There is no evidence in the diff that this removal is related to a security vulnerability, patch, or incident. The removed content appears to be standard operator documentation with usage examples. This could be part of documentation reorganization, deprecation, or content migration, but no security context is provided.

Diff

diff --git a/documentdb/latest/developerguide/filter.md b/documentdb/latest/developerguide/filter.md
index b2e4acd8f..8b1378917 100644
--- a//documentdb/latest/developerguide/filter.md
+++ b//documentdb/latest/developerguide/filter.md
@@ -1 +0,0 @@
-[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#filter "Open PDF")
@@ -3,173 +1,0 @@
-[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
-
-Example (MongoDB Shell)Code examples
-
-# $filter
-
-The `$filter` operator in Amazon DocumentDB is used to apply a filter expression to each element of an array and return an array containing only the elements that match the specified condition. This operator is useful when you need to perform complex filtering operations on array fields within your documents.
-
-**Parameters**
-
-  * `input`: The array field to filter.
-
-  * `as`: The variable name to use for each element of the `input` array within the `cond` expression.
-
-  * `cond`: The boolean expression that determines whether a given element should be included in the output array.
-
-
-
-
-## Example (MongoDB Shell)
-
-The following example demonstrates how to use the `$filter` operator to project each order's customer and create a new array field paidItems containing only the items from the items array where the price is greater than 15. Essentially, it filters each order’s items to include only products that cost more than 15.
-
-**Create sample documents**
-    
-    
-    db.orders.insertMany([
-      { _id: 1, customer: "abc123", items: [
-        { name: "Product A", price: 10, qty: 2 },
-        { name: "Product B", price: 20, qty: 1 }
-      ]},
-      { _id: 2, customer: "def456", items: [
-        { name: "Product C", price: 5, qty: 3 },
-        { name: "Product D", price: 15, qty: 4 }
-      ]},
-      { _id: 3, customer: "ghi789", items: [
-        { name: "Product E", price: 8, qty: 3 },
-        { name: "Product F", price: 12, qty: 1 }
-      ]}
-    ]);
-
-**Query example**
-    
-    
-    db.orders.aggregate([
-      {
-        $project: {
-          customer: 1,
-          paidItems: {
-            $filter: {
-              input: "$items",
-              as: "item",
-              cond: { $gt: ["$$item.price", 15] }
-            }
-          }
-        }
-      }
-    ]).pretty();
-
-**Output**
-    
-    
-    [
-      {
-        _id: 1,
-        customer: 'abc123',
-        paidItems: [ { name: 'Product B', price: 20, qty: 1 } ]
-      },
-      { _id: 2, customer: 'def456', paidItems: [] },
-      { _id: 3, customer: 'ghi789', paidItems: [] }
-    ]
-
-## Code examples
-
-To view a code example for using the `$filter` command, choose the tab for the language that you want to use:
-
-Node.js
-    
-    
-    
-    const { MongoClient } = require('mongodb');
-    
-    async function example() {
-      const uri = 'mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false';
-      const client = new MongoClient(uri);
-    
-      try {
-        await client.connect();
-    
-        const db = client.db('test');
-        const collection = db.collection('orders');
-    
-        const result = await collection.aggregate([
-          {
-            $project: {
-              customer: 1,
-              paidItems: {
-                $filter: {
-                  input: "$items",
-                  as: "item",
-                  cond: { $gt: ["$$item.price", 15] }
-                }
-              }
-            }
-          }
-        ]).toArray();
-    
-        console.log(JSON.stringify(result, null, 2));
-    
-      } catch (error) {
-        console.error('Error:', error);
-      } finally {
-        await client.close();
-      }
-    }
-    
-    example();
-
-Python
-    
-    
-    
-    from pymongo import MongoClient
-    from pprint import pprint
-    
-    def example():
-        uri = 'mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false'
-        
-        with MongoClient(uri) as client:
-            db = client.test
-            collection = db.orders
-    
-            result = list(collection.aggregate([
-                {
-                    '$project': {
-                        'customer': 1,
-                        'paidItems': {
-                            '$filter': {
-                                'input': '$items',
-                                'as': 'item',
-                                'cond': { '$gt': ['$$item.price', 15] }
-                            }
-                        }
-                    }
-                }
-            ]))
-    
-            for doc in result:
-                pprint(doc)
-    
-    example()
-
-![Warning](https://d1ge0kk1l5kms0.cloudfront.net/images/G/01/webservices/console/warning.png) **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)
-
-$exp
-
-$first
-
-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.