Table of Contents

Method Near

Namespace
MongoDB.Driver.Search
Assembly
MongoDB.Driver.dll

Near(SearchPathDefinition<TDocument>, double, double, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near(SearchPathDefinition<TDocument> path, double origin, double pivot, SearchScoreDefinition<TDocument> score = null)

Parameters

path SearchPathDefinition<TDocument>

The indexed field or fields to search.

origin double

The number, date, or geographic point to search near.

pivot double

The value to use to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Near<TField>(Expression<Func<TDocument, TField>>, double, double, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near<TField>(Expression<Func<TDocument, TField>> path, double origin, double pivot, SearchScoreDefinition<TDocument> score = null)

Parameters

path Expression<Func<TDocument, TField>>

The indexed field or fields to search.

origin double

The number, date, or geographic point to search near.

pivot double

The value to use to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Type Parameters

TField

The type of the field.

Near(SearchPathDefinition<TDocument>, int, int, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near(SearchPathDefinition<TDocument> path, int origin, int pivot, SearchScoreDefinition<TDocument> score = null)

Parameters

path SearchPathDefinition<TDocument>

The indexed field or fields to search.

origin int

The number, date, or geographic point to search near.

pivot int

The value to use to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Near<TField>(Expression<Func<TDocument, TField>>, int, int, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near<TField>(Expression<Func<TDocument, TField>> path, int origin, int pivot, SearchScoreDefinition<TDocument> score = null)

Parameters

path Expression<Func<TDocument, TField>>

The indexed field or fields to search.

origin int

The number, date, or geographic point to search near.

pivot int

The value to use to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Type Parameters

TField

The type of the field.

Near(SearchPathDefinition<TDocument>, long, long, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near(SearchPathDefinition<TDocument> path, long origin, long pivot, SearchScoreDefinition<TDocument> score = null)

Parameters

path SearchPathDefinition<TDocument>

The indexed field or fields to search.

origin long

The number, date, or geographic point to search near.

pivot long

The value to use to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Near<TField>(Expression<Func<TDocument, TField>>, long, long, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near<TField>(Expression<Func<TDocument, TField>> path, long origin, long pivot, SearchScoreDefinition<TDocument> score = null)

Parameters

path Expression<Func<TDocument, TField>>

The indexed field or fields to search.

origin long

The number, date, or geographic point to search near.

pivot long

The value to use to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Type Parameters

TField

The type of the field.

Near(SearchPathDefinition<TDocument>, DateTime, long, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near(SearchPathDefinition<TDocument> path, DateTime origin, long pivot, SearchScoreDefinition<TDocument> score = null)

Parameters

path SearchPathDefinition<TDocument>

The indexed field or fields to search.

origin DateTime

The number, date, or geographic point to search near.

pivot long

The value to use to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Near<TField>(Expression<Func<TDocument, TField>>, DateTime, long, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near<TField>(Expression<Func<TDocument, TField>> path, DateTime origin, long pivot, SearchScoreDefinition<TDocument> score = null)

Parameters

path Expression<Func<TDocument, TField>>

The indexed field or fields to search.

origin DateTime

The number, date, or geographic point to search near.

pivot long

The value to use to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Type Parameters

TField

The type of the field.

Near<TCoordinates>(SearchPathDefinition<TDocument>, GeoJsonPoint<TCoordinates>, double, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near<TCoordinates>(SearchPathDefinition<TDocument> path, GeoJsonPoint<TCoordinates> origin, double pivot, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates

Parameters

path SearchPathDefinition<TDocument>

The indexed field or fields to search.

origin GeoJsonPoint<TCoordinates>

The number, date, or geographic point to search near.

pivot double

The value to use to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Type Parameters

TCoordinates

The type of the coordinates.

Near<TCoordinates, TField>(Expression<Func<TDocument, TField>>, GeoJsonPoint<TCoordinates>, double, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

public SearchDefinition<TDocument> Near<TCoordinates, TField>(Expression<Func<TDocument, TField>> path, GeoJsonPoint<TCoordinates> origin, double pivot, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates

Parameters

path Expression<Func<TDocument, TField>>

The indexed field or fields to search.

origin GeoJsonPoint<TCoordinates>

The number, date, or geographic point to search near.

pivot double

The value to user to calculate scores of result documents.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A near search definition.

Type Parameters

TCoordinates

The type of the coordinates

TField

The type of the fields.