Table of Contents

Method Single

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

Single(FieldDefinition<TDocument>)

Creates a search path for a single field.

public SearchPathDefinition<TDocument> Single(FieldDefinition<TDocument> field)

Parameters

field FieldDefinition<TDocument>

The field definition.

Returns

SearchPathDefinition<TDocument>

A single-field search path.

Single<TField>(Expression<Func<TDocument, TField>>)

Creates a search path for a single field.

public SearchPathDefinition<TDocument> Single<TField>(Expression<Func<TDocument, TField>> field)

Parameters

field Expression<Func<TDocument, TField>>

The field definition.

Returns

SearchPathDefinition<TDocument>

A single-field search path.

Type Parameters

TField

The type of the field.