Click or drag to resize

SearchDefinitionBuilder<TDocument>.GeoWithin<TCoordinates, TField> Method (Expression<Func<TDocument, TField>>, GeoJsonGeometry<TCoordinates>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for geographic points within a given geometry.

Namespace:  MongoDB.Driver.Search
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.19.1+3a2a09dd959482f665ffbb5df2557ec541597af4
Syntax
public SearchDefinition<TDocument> GeoWithin<TCoordinates, TField>(
	Expression<Func<TDocument, TField>> path,
	GeoJsonGeometry<TCoordinates> geometry,
	SearchScoreDefinition<TDocument> score = null
)
where TCoordinates : GeoJsonCoordinates

Parameters

path
Type: System.Linq.Expressions.Expression<Func<TDocument, TField>>
Indexed geo type field or fields to search.
geometry
Type: MongoDB.Driver.GeoJsonObjectModel.GeoJsonGeometry<TCoordinates>
GeoJSON object specifying the MultiPolygon or Polygon to search within.
score (Optional)
Type: MongoDB.Driver.Search.SearchScoreDefinition<TDocument>
The score modifier.

Type Parameters

TCoordinates
The type of the coordinates.
TField
The type of the field.

Return Value

Type: SearchDefinition<TDocument>
A geo within search definition.
See Also