Table of Contents

Method Matches

Namespace
MongoDB.Driver.Builders
Assembly
MongoDB.Driver.Legacy.dll

Matches(Expression<Func<TDocument, string>>, BsonRegularExpression)

Tests that the value of the named element matches a regular expression (see $regex).

public IMongoQuery Matches(Expression<Func<TDocument, string>> memberExpression, BsonRegularExpression regex)

Parameters

memberExpression Expression<Func<TDocument, string>>

The member expression representing the element to test.

regex BsonRegularExpression

The regex.

Returns

IMongoQuery

A query.

Matches(Expression<Func<TDocument, IEnumerable<string>>>, BsonRegularExpression)

Tests that any of the values in the named array element matches a regular expression (see $regex).

public IMongoQuery Matches(Expression<Func<TDocument, IEnumerable<string>>> memberExpression, BsonRegularExpression regex)

Parameters

memberExpression Expression<Func<TDocument, IEnumerable<string>>>

The member expression representing the element to test.

regex BsonRegularExpression

The regex.

Returns

IMongoQuery

A query.