@@ -128,6 +128,25 @@ criteria. The following example returns documents that contain the value
128128 var builder = Builders<Flower>.Filter;
129129 var filter = builder.ElemMatch(f => f.Season, s => s == "Summer");
130130
131+ .. tip:: ElemMatch() Overload
132+
133+ The ``ElemMatch()`` method has an overload that accepts a single *filter*
134+ parameter. You can use this overload to perform ``$elemMatch``
135+ queries directly against values. This functionality can support
136+ queries that include nested ``$elemMatch`` statements.
137+
138+ The following code demonstrates how to construct a nested
139+ ``$elemMatch`` query that uses multiple overloads of the
140+ ``ElemMatch()`` method:
141+
142+ .. code-block:: csharp
143+
144+ // ElemMatch() with only filter parameter
145+ var arrayFilter = Builders<MyEntry[]>.Filter.ElemMatch(<filter>);
146+
147+ // ElemMatch() with field name and filter parameters
148+ var filter = Builders<MyClass>.Filter.ElemMatch(<array field name>, arrayFilter);
149+
131150To learn more about array operators, see the :manual:`Array Query Operators
132151</reference/operator/query-array/>` guide in the {+mdb-server+} manual.
133152
@@ -493,4 +512,5 @@ guide, see the following API Documentation:
493512- `SortDefinitionBuilder <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.SortDefinitionBuilder-1.html>`__
494513- `UpdateDefinitionBuilder <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.UpdateDefinitionBuilder-1.html>`__
495514- `IndexKeysDefinitionBuilder <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IndexKeysDefinitionBuilder-1.html>`__
496- - `PipelineDefinitionBuilder <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.PipelineDefinitionBuilder.html>`__
515+ - `PipelineDefinitionBuilder
516+ <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.PipelineDefinitionBuilder.html>`__
0 commit comments