AWS documentdb documentation change
Summary
Entire documentation page for the $ifNull operator has been removed, including all examples, code samples, and explanatory content
Security assessment
This change removes documentation for a MongoDB operator ($ifNull) but provides no evidence of security vulnerability or security-related context. The removal appears to be a routine documentation cleanup or restructuring, not related to addressing any security issue. The examples removed were standard MongoDB aggregation examples with no security implications mentioned.
Diff
diff --git a/documentdb/latest/developerguide/ifNull.md b/documentdb/latest/developerguide/ifNull.md index 89f746851..8b1378917 100644 --- a//documentdb/latest/developerguide/ifNull.md +++ b//documentdb/latest/developerguide/ifNull.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#ifNull "Open PDF") @@ -3,140 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $ifNull - -The `$ifNull` operator is used to return a specified value if the input expression evaluates to null or undefined. This operator can be useful in scenarios where you want to provide a default value or handle null/undefined cases. - -**Parameters** - - * `expression`: The expression to evaluate. - - * `replacement`: The value to return if the `<expression>` evaluates to null or undefined. - - - - -## Example (MongoDB Shell) - -The following example demonstrates the usage of the `$ifNull` operator to provide a default value when the `name` field is null or undefined. - -**Create sample documents** - - - db.users.insertMany([ - { _id: 1, name: "John" }, - { _id: 2, name: null }, - { _id: 3 } - ]); - -**Query example** - - - db.users.aggregate([ - { - $project: { - _id: 1, - name: { $ifNull: ["$name", "No Name"] } - } - } - ]); - -**Output** - - - [ - { "_id": 1, "name": "John" }, - { "_id": 2, "name": "No Name" }, - { "_id": 3, "name": "No Name" } - ] - -## Code examples - -To view a code example for using the `$ifNull` command, 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('users'); - - const pipeline = [ - { - $project: { - _id: 1, - name: { $ifNull: ["$name", "No Name"] } - } - } - ]; - - const cursor = await collection.aggregate(pipeline); - - await cursor.forEach(doc => { - console.log(doc); - }); - - 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.users - - pipeline = [ - { - "$project": { - "_id": 1, - "name": { "$ifNull": ["$name", "No Name"] } - } - } - ] - - result = collection.aggregate(pipeline) - - for doc in result: - print(doc) - - 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) - -$hour - -$in - -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.