AWS documentdb documentation change
Summary
Entire documentation page for the $literal operator in Amazon DocumentDB has been removed, including examples and code snippets.
Security assessment
The change removes general documentation about the $literal operator without any mention of security vulnerabilities, patches, or security-related updates. This appears to be a routine documentation cleanup or restructuring, not tied to a security issue.
Diff
diff --git a/documentdb/latest/developerguide/literal.md b/documentdb/latest/developerguide/literal.md index c1db847ab..8b1378917 100644 --- a//documentdb/latest/developerguide/literal.md +++ b//documentdb/latest/developerguide/literal.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#literal "Open PDF") @@ -3,148 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $literal - -The `$literal` operator in Amazon DocumentDB is used to represent a literal value within an aggregation pipeline stage. It allows you to include a specific value, such as a number, string, or boolean, without interpreting it as a field reference or expression. - -This operator is particularly useful when you need to include a literal value as part of a more complex aggregation pipeline, such as when building dynamic query filters or performing calculations. - -**Parameters** - -None - -## Example (MongoDB Shell) - -The following example demonstrates the use of the `$literal` operator to include a literal value in an aggregation pipeline. The `$literal` operator is used to include the value 18 as a literal value in the $gt expression. This allows the aggregation pipeline to compare the age field against the literal value 18 to determine if the person is an adult. - -**Create sample documents** - - - db.collection.insertMany([ - { "name": "John Doe", "age": 30, "city": "New York" }, - { "name": "Jane Doe", "age": 25, "city": "Los Angeles" }, - { "name": "Bob Smith", "age": 35, "city": "Chicago" } - ]); - -**Query example** - - - db.collection.aggregate([ - { - $project: { - name: 1, - age: 1, - city: 1, - isAdult: { $gt: ["$age", { $literal: 18 }] } - } - } - ]); - -**Output** - - - [ - { - "_id": ObjectId("601234567890abcdef012345"), - "name": "John Doe", - "age": 30, - "city": "New York", - "isAdult": true - }, - { - "_id": ObjectId("601234567890abcdef012346"), - "name": "Jane Doe", - "age": 25, - "city": "Los Angeles", - "isAdult": true - }, - { - "_id": ObjectId("601234567890abcdef012347"), - "name": "Bob Smith", - "age": 35, - "city": "Chicago", - "isAdult": true - } - ] - -## Code examples - -To view a code example for using the `$literal` 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('collection'); - - const result = await collection.aggregate([ - { - $project: { - name: 1, - age: 1, - city: 1, - isAdult: { $gt: ["$age", { $literal: 18 }] } - } - } - ]).toArray(); - - console.log(result); - 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.collection - - result = list(collection.aggregate([ - { - '$project': { - 'name': 1, - 'age': 1, - 'city': 1, - 'isAdult': { '$gt': ["$age", { '$literal': 18 }] } - } - } - ])) - - 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) - -$limit - -$ln - -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.