AWS documentdb documentation change
Summary
Entire documentation page for the $type aggregation operator was removed, including examples in MongoDB Shell, Node.js, and Python
Security assessment
This change removes documentation for the $type aggregation operator but provides no evidence of security vulnerability remediation. The removed content includes standard examples and connection strings with TLS settings, but there's no mention of security issues, vulnerabilities, or security-related fixes. This appears to be routine documentation maintenance or restructuring.
Diff
diff --git a/documentdb/latest/developerguide/type-aggregation.md b/documentdb/latest/developerguide/type-aggregation.md index 3e9f39bc0..8b1378917 100644 --- a//documentdb/latest/developerguide/type-aggregation.md +++ b//documentdb/latest/developerguide/type-aggregation.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#type-aggregation "Open PDF") @@ -3,130 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $type - -The `$type` aggregation operator returns the BSON data type of a specified field. This is useful for identifying the data type of field values during aggregation operations. - -**Parameters** - - * `expression`: The field or expression whose type to return. - - - - -## Example (MongoDB Shell) - -The following example demonstrates using the `$type` operator to identify the data type of the price field for each product. - -**Create sample documents** - - - db.inventory.insertMany([ - { _id: 1, item: "Notebook", price: 15.99 }, - { _id: 2, item: "Pen", price: "2.50" }, - { _id: 3, item: "Eraser", price: 1 }, - { _id: 4, item: "Ruler", price: null } - ]); - -**Query example** - - - db.inventory.aggregate([ - { - $project: { - item: 1, - price: 1, - priceType: { $type: "$price" } - } - } - ]); - -**Output** - - - [ - { _id: 1, item: 'Notebook', price: 15.99, priceType: 'double' }, - { _id: 2, item: 'Pen', price: '2.50', priceType: 'string' }, - { _id: 3, item: 'Eraser', price: 1, priceType: 'int' }, - { _id: 4, item: 'Ruler', price: null, priceType: 'null' } - ] - -## Code examples - -To view a code example for using the `$type` 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('inventory'); - - const result = await collection.aggregate([ - { - $project: { - item: 1, - price: 1, - priceType: { $type: "$price" } - } - } - ]).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['inventory'] - - result = list(collection.aggregate([ - { - '$project': { - 'item': 1, - 'price': 1, - 'priceType': { '$type': '$price' } - } - } - ])) - - 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) - -$trim - -$unset - -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.