Table of Contents

Method ElemMatch

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

ElemMatch<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, Func<QueryBuilder<TValue>, IMongoQuery>)

Returns the first matching element in the array specified by name.

public FieldsBuilder<TDocument> ElemMatch<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>> memberExpression, Func<QueryBuilder<TValue>, IMongoQuery> elementQueryBuilderFunction)

Parameters

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

The member expression.

elementQueryBuilderFunction Func<QueryBuilder<TValue>, IMongoQuery>

The element query builder function.

Returns

FieldsBuilder<TDocument>

The build (so method calls can be chained).

Type Parameters

TValue

The type of the value.