AWS documentdb documentation change
Summary
Entire documentation page for the $minDistance operator was removed, including all examples and code samples
Security assessment
This change removes documentation for a specific MongoDB operator ($minDistance) used with geospatial queries. There is no evidence in the diff that this removal is related to a security vulnerability. The change appears to be routine documentation maintenance, possibly removing deprecated or unsupported content. No security implications are evident from the removal of this operator documentation.
Diff
diff --git a/documentdb/latest/developerguide/minDistance.md b/documentdb/latest/developerguide/minDistance.md index 4a93fed7d..8b1378917 100644 --- a//documentdb/latest/developerguide/minDistance.md +++ b//documentdb/latest/developerguide/minDistance.md @@ -1 +0,0 @@ -[](/pdfs/documentdb/latest/developerguide/developerguide.pdf#minDistance "Open PDF") @@ -3,167 +1,0 @@ -[Documentation](/index.html)[Amazon DocumentDB](/documentdb/index.html)[Developer Guide](what-is.html) - -Example (MongoDB Shell)Code examples - -# $minDistance - -`$minDistance` is a find operator used in conjunction with `$nearSphere` or `$geoNear` to filter documents that are at least at the specified minimum distance from the center point. This operator is supported in Amazon DocumentDB and functions similarly to its counterpart in MongoDB. - -**Parameters** - - * `$minDistance`: The minimum distance (in meters) from the center point to include documents in the results. - - - - -## Example (MongoDB Shell) - -In this example, we'll find all restaurants within a 2-kilometer radius of a specific location in Seattle, Washington. - -**Create sample documents** - - - db.usarestaurants.insertMany([ - { - "state": "Washington", - "city": "Seattle", - "name": "Noodle House", - "rating": 4.8, - "location": { - "type": "Point", - "coordinates": [-122.3517, 47.6159] - } - }, - { - "state": "Washington", - "city": "Seattle", - "name": "Pike Place Grill", - "rating": 4.5, - "location": { - "type": "Point", - "coordinates": [-122.3412, 47.6102] - } - }, - { - "state": "Washington", - "city": "Bellevue", - "name": "The Burger Joint", - "rating": 4.2, - "location": { - "type": "Point", - "coordinates": [-122.2007, 47.6105] - } - } - ]); - -**Query example** - - - db.usarestaurants.find({ - "location": { - "$nearSphere": { - "$geometry": { - "type": "Point", - "coordinates": [-122.3516, 47.6156] - }, - "$minDistance": 1, - "$maxDistance": 2000 - } - } - }, { - "name": 1 - }); - -**Output** - - - { "_id" : ObjectId("611f3da985009a81ad38e74b"), "name" : "Noodle House" } - { "_id" : ObjectId("611f3da985009a81ad38e74c"), "name" : "Pike Place Grill" } - -## Code examples - -To view a code example for using the `$minDistance` command, choose the tab for the language that you want to use: - -Node.js - - - - const { MongoClient } = require('mongodb'); - - async function findRestaurantsNearby() { - 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('usarestaurants'); - - const result = await collection.find({ - "location": { - "$nearSphere": { - "$geometry": { - "type": "Point", - "coordinates": [-122.3516, 47.6156] - }, - "$minDistance": 1, - "$maxDistance": 2000 - } - } - }, { - "projection": { "name": 1 } - }).toArray(); - - console.log(result); - client.close(); - } - - findRestaurantsNearby(); - -Python - - - - from pymongo import MongoClient - - def find_restaurants_nearby(): - 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.usarestaurants - - result = list(collection.find({ - "location": { - "$nearSphere": { - "$geometry": { - "type": "Point", - "coordinates": [-122.3516, 47.6156] - }, - "$minDistance": 1, - "$maxDistance": 2000 - } - } - }, { - "projection": {"name": 1} - })) - - print(result) - client.close() - - find_restaurants_nearby() - - **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) - -$maxDistance - -$near - -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.