Click or drag to resize

SearchDefinitionBuilderTDocumentEqualsTField Method (ExpressionFuncTDocument, TField, TField, SearchScoreDefinitionTDocument)

Creates a search definition that queries for documents where an indexed field is equal to the specified value. Supported value types are boolean, numeric, ObjectId and date.

Namespace:  MongoDB.Driver.Search
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.22.0+75246110ed1247226fcc7f8eb2c54ffab745693e
Syntax
public SearchDefinition<TDocument> Equals<TField>(
	Expression<Func<TDocument, TField>> path,
	TField value,
	SearchScoreDefinition<TDocument> score = null
)
where TField : struct, new(), IComparable<TField>

Parameters

path
Type: System.Linq.ExpressionsExpressionFuncTDocument, TField
The indexed field to search.
value
Type: TField
The value to query for.
score (Optional)
Type: MongoDB.Driver.SearchSearchScoreDefinitionTDocument
The score modifier.

Type Parameters

TField
The type of the field.

Return Value

Type: SearchDefinitionTDocument
An equality search definition.
See Also