AWS documentdb documentation change
Summary
Removed entire documentation page for the $toBool operator including all examples, code samples, and usage instructions
Security assessment
This change removes documentation for a MongoDB operator ($toBool) but provides no evidence of security vulnerability, incident, or security feature documentation. The removed content appears to be standard operator documentation with code examples. There's no mention of security fixes, vulnerabilities, or security-related changes in the removed content.
Diff
diff --git a/documentdb/latest/developerguide/toBool.md b/documentdb/latest/developerguide/toBool.md index e5285f6cd..8b1378917 100644 --- a//documentdb/latest/developerguide/toBool.md +++ b//documentdb/latest/developerguide/toBool.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#toBool "Open PDF") @@ -3,135 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $toBool - -The `$toBool` operator in Amazon DocumentDB converts an expression to a boolean value. - -**Parameters** - - * `expression`: The expression to be converted to a boolean value. - - - - -**Note** : Any string converts to `true`. - -## Example (MongoDB Shell) - -The following example demonstrates using the `$toBool` operator to normalize device state values from different data types. - -**Create sample documents** - - - db.deviceStates.insertMany([ - { _id: 1, deviceId: "sensor-001", status: true }, - { _id: 2, deviceId: "camera-002", status: 1 }, - { _id: 3, deviceId: "thermostat-003", status: "active" }, - { _id: 4, deviceId: "doorlock-004", status: 0 } - ]); - -**Query example** - - - db.deviceStates.aggregate([ - { - $project: { - _id: 1, - deviceId: 1, - isActive: { $toBool: "$status" } - } - } - ]); - -**Output** - - - [ - { "_id": 1, "deviceId": "sensor-001", "isActive": true }, - { "_id": 2, "deviceId": "camera-002", "isActive": true }, - { "_id": 3, "deviceId": "thermostat-003", "isActive": true }, - { "_id": 4, "deviceId": "doorlock-004", "isActive": false } - ] - -## Code examples - -To view a code example for using the `$toBool` 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 collection = db.collection('deviceStates'); - - const result = await collection.aggregate([ - { - $project: { - _id: 1, - deviceId: 1, - isActive: { $toBool: '$status' } - } - } - ]).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'] - collection = db['deviceStates'] - - result = list(collection.aggregate([ - { - '$project': { - '_id': 1, - 'deviceId': 1, - 'isActive': { '$toBool': '$status' } - } - } - ])) - - print(result) - - client.close() - - if __name__ == '__main__': - main() - - **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) - -$switch - -$toDate - -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.