AWS Security ChangesHomeSearch

AWS documentdb documentation change

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

File: documentdb/latest/developerguide/size.md

Summary

Entire documentation page for the $size aggregation operator has been removed, including examples in MongoDB Shell, Node.js, and Python.

Security assessment

This change removes documentation content entirely but shows no evidence of addressing a security vulnerability. The removed content includes standard aggregation operator examples without any security context or vulnerability mentions. This appears to be part of a documentation cleanup or reorganization, possibly consolidating $size operator documentation elsewhere.

Diff

diff --git a/documentdb/latest/developerguide/size.md b/documentdb/latest/developerguide/size.md
index 44da65c69..8b1378917 100644
--- a//documentdb/latest/developerguide/size.md
+++ b//documentdb/latest/developerguide/size.md
@@ -1 +0,0 @@
-[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#size "Open PDF")
@@ -3,127 +1,0 @@
-[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html)
-
-Example (MongoDB Shell)Code examples
-
-# $size
-
-The `$size` operator is used to return the count of items within an array field. This can be used to determine the number of elements in an array stored in a document.
-
-**Parameters**
-
-  * `field`: The field path whose array size you want to return.
-
-
-
-
-## Example (MongoDB Shell)
-
-This example shows how to use the `$size` operator to return the count of teams each user is following.
-
-**Create sample documents**
-    
-    
-    db.profiles.insertMany([
-      { _id: 1, name: "John Doe", teams: ["Acme", "Widgets", "Gadgets"] },
-      { _id: 2, name: "Jane Smith", teams: ["Acme", "Gadgets"] },
-      { _id: 3, name: "Bob Johnson", teams: ["Acme", "Widgets", "Gadgets"] }
-    ]);
-
-**Query example**
-    
-    
-    db.profiles.aggregate([
-      {
-        $project: {
-          _id: 0,
-          name: 1,
-          "numberOfTeams": { $size: "$teams" }
-        }
-      }
-    ])
-
-**Output**
-    
-    
-    [
-      { name: 'John Doe', numberOfTeams: 3 },
-      { name: 'Jane Smith', numberOfTeams: 2 },
-      { name: 'Bob Johnson', numberOfTeams: 3 }
-    ]
-
-## Code examples
-
-To view a code example for using the `$size` 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 profiles = db.collection('profiles');
-    
-      const result = await profiles.aggregate([
-        {
-          $project: {
-            item: 1,
-            "numberOfTeams": { $size: "$teams" }
-          }
-        }
-      ]).toArray();
-    
-      console.log(result);
-      await client.close();
-    }
-    
-    main();
-
-Python
-    
-    
-    
-    from pymongo import MongoClient
-    
-    def main():
-        client = MongoClient('mongodb://<username>:<password>@<cluster-endpoint>:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false')
-        db = client['test']
-        profiles = db.profiles
-    
-        result = list(profiles.aggregate([
-            {
-                '$project': {
-                    'item': 1,
-                    'numberOfTeams': { '$size': '$teams' }
-                }
-            }
-        ]))
-    
-        print(result)
-        client.close()
-    
-    if __name__ == "__main__":
-        main()
-
-![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)
-
-$slice
-
-$sort
-
-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.