Method Regex
Regex(FieldDefinition<TDocument>, BsonRegularExpression)
Creates a regular expression filter.
public FilterDefinition<TDocument> Regex(FieldDefinition<TDocument> field, BsonRegularExpression regex)
Parameters
field
FieldDefinition<TDocument>The field.
regex
BsonRegularExpressionThe regex.
Returns
- FilterDefinition<TDocument>
A regular expression filter.
Regex(Expression<Func<TDocument, object>>, BsonRegularExpression)
Creates a regular expression filter.
public FilterDefinition<TDocument> Regex(Expression<Func<TDocument, object>> field, BsonRegularExpression regex)
Parameters
field
Expression<Func<TDocument, object>>The field.
regex
BsonRegularExpressionThe regex.
Returns
- FilterDefinition<TDocument>
A regular expression filter.