From a2ec8d7410d71025b7869bbe795d620fb458e2ef Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 1 Apr 2025 09:58:50 -0400 Subject: [PATCH 1/4] merge upstream --- source/fundamentals/builders.txt | 21 ++++++++++++++++++++- source/whats-new.txt | 9 +++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/source/fundamentals/builders.txt b/source/fundamentals/builders.txt index a9bcfd4d..defeccd6 100644 --- a/source/fundamentals/builders.txt +++ b/source/fundamentals/builders.txt @@ -128,6 +128,24 @@ criteria. The following example returns documents that contain the value var builder = Builders.Filter; var filter = builder.ElemMatch(f => f.Season, s => s == "Summer"); +.. tip:: ElemMatch() Overload + + The ``ElemMatch()`` method has an overload to accept a single filter + parameter. This functionality supports performing queries that + include nested ``$elemMatch`` statements. + + The following code demonstrates how to construct a nested + ``$elemMatch`` query that uses both implementations of the + ``ElemMatch()`` method: + + .. code-block:: csharp + + // ElemMatch() with only filter parameter + var arrayFilter = Builders.Filter.ElemMatch(); + + // ElemMatch() with field name and filter parameters + var filter = Builders.Filter.ElemMatch(, arrayFilter); + To learn more about array operators, see the :manual:`Array Query Operators ` guide in the {+mdb-server+} manual. @@ -493,4 +511,5 @@ guide, see the following API Documentation: - `SortDefinitionBuilder <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.SortDefinitionBuilder-1.html>`__ - `UpdateDefinitionBuilder <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.UpdateDefinitionBuilder-1.html>`__ - `IndexKeysDefinitionBuilder <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IndexKeysDefinitionBuilder-1.html>`__ -- `PipelineDefinitionBuilder <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.PipelineDefinitionBuilder.html>`__ \ No newline at end of file +- `PipelineDefinitionBuilder + <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.PipelineDefinitionBuilder.html>`__ diff --git a/source/whats-new.txt b/source/whats-new.txt index ba45919c..aa720261 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -74,9 +74,10 @@ The 3.3 driver release includes the following new features: - Adds support for the ``$rankFusion`` aggregation stage, which enables rank-based result scoring on combined results from multiple pipelines. -- Adds support for nested :manual:`$elemMatch ` - queries by providing an overload of the ``ElemMatch()`` method that takes only a filter - parameter. To learn more, see the :ref:`csharp-builders-array-operators` section of the +- Adds support for :manual:`$elemMatch ` + queries directly against values by providing an overload of the + ``ElemMatch()`` method that takes only a filter parameter. To learn + more, see the :ref:`csharp-builders-array-operators` section of the Builders guide. - Adds support for using the ``OfType()`` method and ``is`` operator to check @@ -400,4 +401,4 @@ The 2.25 driver release includes the following new features: - Added support for overriding the ``"mongodb"`` service name with a custom one by using the ``srvServiceName`` connection option. - Improved behavior of bulk write operations to prevent enumerating the requests - parameter more than once. \ No newline at end of file + parameter more than once. From 4dc2b9c78d0592575039914a20e7a79321fdecde Mon Sep 17 00:00:00 2001 From: rustagir Date: Wed, 26 Mar 2025 12:11:00 -0400 Subject: [PATCH 2/4] small fix --- source/fundamentals/builders.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/fundamentals/builders.txt b/source/fundamentals/builders.txt index defeccd6..bba1c209 100644 --- a/source/fundamentals/builders.txt +++ b/source/fundamentals/builders.txt @@ -135,7 +135,7 @@ criteria. The following example returns documents that contain the value include nested ``$elemMatch`` statements. The following code demonstrates how to construct a nested - ``$elemMatch`` query that uses both implementations of the + ``$elemMatch`` query that uses multiple overloads of the ``ElemMatch()`` method: .. code-block:: csharp From d6c573a79bb6feeb555f2ac1fafc1c6b532e4be9 Mon Sep 17 00:00:00 2001 From: rustagir Date: Thu, 27 Mar 2025 09:39:04 -0400 Subject: [PATCH 3/4] MW PR fixes 1 --- source/fundamentals/builders.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/fundamentals/builders.txt b/source/fundamentals/builders.txt index bba1c209..538ffe6b 100644 --- a/source/fundamentals/builders.txt +++ b/source/fundamentals/builders.txt @@ -130,8 +130,8 @@ criteria. The following example returns documents that contain the value .. tip:: ElemMatch() Overload - The ``ElemMatch()`` method has an overload to accept a single filter - parameter. This functionality supports performing queries that + The ``ElemMatch()`` method has an overload that accepts a single filter + parameter. You can use this overload to perform queries that include nested ``$elemMatch`` statements. The following code demonstrates how to construct a nested From 997328dcdb239469a673685ef6fe5018103f1080 Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 1 Apr 2025 09:56:44 -0400 Subject: [PATCH 4/4] RStam tech review --- source/fundamentals/builders.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/fundamentals/builders.txt b/source/fundamentals/builders.txt index 538ffe6b..39e58c76 100644 --- a/source/fundamentals/builders.txt +++ b/source/fundamentals/builders.txt @@ -130,9 +130,10 @@ criteria. The following example returns documents that contain the value .. tip:: ElemMatch() Overload - The ``ElemMatch()`` method has an overload that accepts a single filter - parameter. You can use this overload to perform queries that - include nested ``$elemMatch`` statements. + The ``ElemMatch()`` method has an overload that accepts a single *filter* + parameter. You can use this overload to perform ``$elemMatch`` + queries directly against values. This functionality can support + queries that include nested ``$elemMatch`` statements. The following code demonstrates how to construct a nested ``$elemMatch`` query that uses multiple overloads of the