Skip to content

Commit b2d4f86

Browse files
committed
Merge remote-tracking branch 'upstream/master' into DOCSP-49279-convert-linq-mthd
2 parents f8699f8 + f6d5c03 commit b2d4f86

File tree

4 files changed

+48
-8
lines changed

4 files changed

+48
-8
lines changed

source/fundamentals/authentication/x509.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ Code Placeholders
3838

3939
The code examples on this page use the following placeholders:
4040

41-
- ``+srv``: Include this option in your connection string prefix only if you are connecting
42-
to a MongoDB Atlas cluster. To learn more about the ``+srv`` option, see
43-
:manual:`Connection String Formats </reference/connection-string/#connection-string-formats>`
44-
in the {+mdb-server+} manual.
41+
- ``+srv``: Include this option in your connection string prefix only if you are
42+
connecting to a MongoDB Atlas cluster. If you're using a
43+
``MongoClientSettings`` object, you can specify the ``srv`` format by setting
44+
the ``Scheme`` property to ``ConnectionStringScheme.MongoDBPlusSrv``. To learn
45+
more about the ``+srv`` option, see :manual:`Connection String Formats </reference/connection-string/#connection-string-formats>` in the
46+
{+mdb-server+} manual.
4547
- ``<hostname>``: The network address of your MongoDB deployment.
4648
- ``<port>``: The port number of the MongoDB deployment. If you omit this parameter,
4749
the driver uses the default port number (``27017``). You don't need a port number
@@ -119,6 +121,7 @@ see the corresponding syntax:
119121
},
120122
UseTls = true,
121123
Server = new MongoServerAddress("<hostname>"[, "<port>"]),
124+
Scheme = ConnectionStringScheme.MongoDBPlusSrv, // Needed when connecting to MongoDB Atlas
122125
};
123126

124127
Troubleshooting

source/fundamentals/crud/write-operations/replace.txt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,23 @@ The ``ReplaceOptions`` class contains the following properties:
183183

184184
**Data Type:** ``bool``
185185

186+
* - ``Sort``
187+
- Determines which document the operation replaces if the query
188+
selects multiple documents, because the replace operation replaces
189+
the first document in the sort order specified. To set this
190+
option, you must instantiate an ``ReplaceOptions<T>`` instance
191+
that uses a generic type that models your data, as shown in the
192+
following code:
193+
194+
.. code-block:: csharp
195+
196+
var options = new ReplaceOptions<Restaurant>
197+
{
198+
Sort = Builders<Restaurant>.Sort.Ascending(r => r.Name)
199+
};
200+
201+
**Data Type:** ``SortDefinition<T>``
202+
186203
* - ``Let``
187204
- Gets or sets the let document.
188205
See :manual:`the {+mdb-server+} manual </reference/command/update/#std-label-update-let-syntax>`
@@ -268,4 +285,5 @@ see the following API documentation:
268285
* `ReplaceOne() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IMongoCollection-1.ReplaceOne.html>`__
269286
* `ReplaceOneAsync() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IMongoCollection-1.ReplaceOneAsync.html>`__
270287
* `ReplaceOptions <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.ReplaceOptions.html>`__
271-
* `ReplaceOneResult <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.ReplaceOneResult.html>`__
288+
* `ReplaceOneResult
289+
<{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.ReplaceOneResult.html>`__

source/includes/page-templates/update/update.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,23 @@ The ``UpdateOptions`` class contains the following properties:
192192

193193
**Data Type:** ``bool``
194194

195+
* - ``Sort``
196+
- Determines which document the operation updates if the query
197+
selects multiple documents, because the update operation updates
198+
the first document in the sort order specified. To set this
199+
option, you must instantiate an ``UpdateOptions<T>`` instance
200+
that uses a generic type that models your data, as shown in the
201+
following code:
202+
203+
.. code-block:: csharp
204+
205+
var options = new UpdateOptions<Restaurant>
206+
{
207+
Sort = Builders<Restaurant>.Sort.Ascending(r => r.Name)
208+
};
209+
210+
**Data Type:** ``SortDefinition<T>``
211+
195212
* - ``Let``
196213
- Gets or sets the let document.
197214
See :manual:`the {+mdb-server+} manual </reference/command/update/#std-label-update-let-syntax>`

source/whats-new.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,11 @@ The 3.1 driver release includes the following new features:
179179
Vector Search, see :atlas:`Run Vector Search Queries </atlas-vector-search/vector-search-stage>`
180180
in the Atlas Search documentation.
181181

182-
- Adds support for the ``sort`` option to be passed to update commands. To learn more about
183-
using update commands with the {+driver-short+}, see :ref:`csharp-update-one` and
184-
:ref:`csharp-update-many`.
182+
- Adds a sort option for update and replace operations. This change
183+
allows you to set a sort order if multiple documents match your
184+
filter when attempting to update or replace a single document. To
185+
learn more, see the :ref:`csharp-update-one` and
186+
:ref:`csharp-replace-operation` guides.
185187

186188
For more information about this release, see the :github:`v3.1 release notes
187189
</mongodb/mongo-csharp-driver/releases/tag/v3.1.0>`.

0 commit comments

Comments
 (0)