Table of Contents

Method Regex

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

Regex(SearchPathDefinition<TDocument>, SearchQueryDefinition, bool, SearchScoreDefinition<TDocument>)

Creates a search definition that interprets the query as a regular expression.

public SearchDefinition<TDocument> Regex(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, bool allowAnalyzedField = false, SearchScoreDefinition<TDocument> score = null)

Parameters

path SearchPathDefinition<TDocument>

The indexed field or fields to search.

query SearchQueryDefinition

The string or strings to search for.

allowAnalyzedField bool

Must be set to true if the query is run against an analyzed field.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A regular expression search definition.

Regex<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, bool, SearchScoreDefinition<TDocument>)

Creates a search definition that interprets the query as a regular expression.

public SearchDefinition<TDocument> Regex<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, bool allowAnalyzedField = false, SearchScoreDefinition<TDocument> score = null)

Parameters

path Expression<Func<TDocument, TField>>

The indexed field or fields to search.

query SearchQueryDefinition

The string or strings to search for.

allowAnalyzedField bool

Must be set to true if the query is run against an analyzed field.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A regular expression search definition.

Type Parameters

TField

The type of the field.