From 6923881e5a40eec64e4236b0deb6d623ca12a7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Fri, 11 Sep 2026 08:47:20 +0100 Subject: [PATCH 1/3] fix(mongodb-constants): update $geoNear template COMPASS-6532 --- .../mongodb-constants/src/stage-operators.ts | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/mongodb-constants/src/stage-operators.ts b/packages/mongodb-constants/src/stage-operators.ts index e0957acee..9b3d4740c 100644 --- a/packages/mongodb-constants/src/stage-operators.ts +++ b/packages/mongodb-constants/src/stage-operators.ts @@ -387,22 +387,27 @@ const STAGE_OPERATORS = [ comment: `/** * near: The point to search near. * distanceField: The calculated distance. - * maxDistance: The maximum distance, in meters, documents can be before being excluded from results. - * query: Limits results that match the query + * maxDistance: Optional maximum distance, in meters, documents can be before being excluded from results. + * minDistance: Optional minimum distance from the center point. + * query: Limits results that match the query. * includeLocs: Optional. Labels and includes the point used to match the document. - * num: Optional. The maximum number of documents to return. + * distanceMultiplier: Optional factor to multiply returned distances by. + * key: Optional geospatial indexed field to use. * spherical: Defaults to false. Specifies whether to use spherical geometry. */ `, + snippet: `{ - near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, - distanceField: '\${3:string}', - maxDistance: \${4:number}, - query: {\${5}}, - includeLocs: '\${6}', - num: \${7:number}, - spherical: \${8:boolean} -}`, + near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, + distanceField: '\${3:string}', + maxDistance: \${4:number}, + minDistance: \${5:number}, + query: {\${6}}, + includeLocs: '\${7:string}', + distanceMultiplier: \${8:number}, + key: '\${9:string}', + spherical: \${10:boolean} + }`, }, { name: '$graphLookup', From c40f99d92cf5de5291fa802ea014ba64a999980c Mon Sep 17 00:00:00 2001 From: Lucia Harcekova <119792460+LuciaHarcekova@users.noreply.github.com> Date: Fri, 11 Sep 2026 10:18:21 +0100 Subject: [PATCH 2/3] Update packages/mongodb-constants/src/stage-operators.ts Co-authored-by: Alena Khineika --- packages/mongodb-constants/src/stage-operators.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/mongodb-constants/src/stage-operators.ts b/packages/mongodb-constants/src/stage-operators.ts index 9b3d4740c..5edfd8803 100644 --- a/packages/mongodb-constants/src/stage-operators.ts +++ b/packages/mongodb-constants/src/stage-operators.ts @@ -396,7 +396,6 @@ const STAGE_OPERATORS = [ * spherical: Defaults to false. Specifies whether to use spherical geometry. */ `, - snippet: `{ near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, distanceField: '\${3:string}', From 9ac8714c4b3e6c138c89cfd6b3b924b94dde6b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Fri, 11 Sep 2026 11:24:13 +0100 Subject: [PATCH 3/3] docs: add " let option" decription for near in $geoNear --- .../mongodb-constants/src/stage-operators.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/mongodb-constants/src/stage-operators.ts b/packages/mongodb-constants/src/stage-operators.ts index 5edfd8803..6679dae4a 100644 --- a/packages/mongodb-constants/src/stage-operators.ts +++ b/packages/mongodb-constants/src/stage-operators.ts @@ -385,7 +385,7 @@ const STAGE_OPERATORS = [ namespaces: [...ANY_NAMESPACE], description: 'Returns documents based on proximity to a geospatial point.', comment: `/** - * near: The point to search near. + * near: The point to search near, supports the let option and bound let option. * distanceField: The calculated distance. * maxDistance: Optional maximum distance, in meters, documents can be before being excluded from results. * minDistance: Optional minimum distance from the center point. @@ -397,16 +397,16 @@ const STAGE_OPERATORS = [ */ `, snippet: `{ - near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, - distanceField: '\${3:string}', - maxDistance: \${4:number}, - minDistance: \${5:number}, - query: {\${6}}, - includeLocs: '\${7:string}', - distanceMultiplier: \${8:number}, - key: '\${9:string}', - spherical: \${10:boolean} - }`, + near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, + distanceField: '\${3:string}', + maxDistance: \${4:number}, + minDistance: \${5:number}, + query: {\${6}}, + includeLocs: '\${7:string}', + distanceMultiplier: \${8:number}, + key: '\${9:string}', + spherical: \${10:boolean} +}`, }, { name: '$graphLookup',