Skip to content

Commit a249803

Browse files
committed
wip
1 parent 9ebc298 commit a249803

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed

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

+4-6
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ multiple update operations.
125125

126126
The following code example uses the ``Combine()`` method to combine a
127127
:manual:`$set </reference/operator/update/set/#mongodb-update-up.-set>` operation and an
128-
:manual:`$unset </reference/operator/update/pop/#mongodb-update-up.-unset>`
128+
:manual:`$unset </reference/operator/update/unset/#mongodb-update-up.-unset>`
129129
operation:
130130

131131
.. tabs::
@@ -257,11 +257,8 @@ operation:
257257
Customize the Update Operation
258258
------------------------------
259259

260-
To combine multiple update definitions into one, call the ``Builders.Update.Combine()`` method.
261-
This method accepts the following parameter:
262-
263-
The preceding update methods optionally accept an ``UpdateOptions`` object as an additional
264-
parameter. You can use this argument to configure the update operation.
260+
The update methods optionally accept an ``UpdateOptions`` object as a
261+
parameter. You can use this argument to customize the update operation.
265262

266263
The ``UpdateOptions`` class contains the following properties:
267264

@@ -278,6 +275,7 @@ The ``UpdateOptions`` class contains the following properties:
278275
for more information.
279276

280277
**Data Type:** IEnumerable<`ArrayFilterDefinition <{+new-api-root+>/MongoDB.Driver/MongoDB.Driver.ArrayFilterDefinition.html>`__>
278+
**Data Type**: Action<`ClusterBuilder <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.Core.Configuration.ClusterBuilder.html>`__>
281279

282280
* - ``BypassDocumentValidation``
283281
- Specifies whether the update operation bypasses document validation. This lets you

source/fundamentals/crud/write-operations/update/fields.txt

+16-21
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ Update Fields
2020
Overview
2121
--------
2222

23-
In this guide, you can learn how to use the {+driver-long+} to update the
24-
values of fields in MongoDB documents.
23+
On this page, you can learn how to use the {+driver-long+} to update
24+
fields in MongoDB documents. This page describes how to create ``UpdateDefinition<TDocument>``
25+
objects that specify the update operations you want to perform on fields.
26+
You can pass these objects to the update methods described on *this page.*
2527

26-
The {+driver-short+} provides the following methods to update fields:
27-
28-
- ``UpdateOne()`` or ``UpdateOneAsync()``
28+
The {+driver-short+} supports the field update operators described in the
29+
:manual:`{+mdb-server+} manual </reference/operator/update/#fields>`. To specify an
30+
update operation, call the corresponding method from the ``Builders.Update`` property.
31+
The following sections describe these methods in more detail.
2932

3033
.. tip:: Interactive Lab
3134

@@ -75,16 +78,8 @@ and load this sample data.
7578

7679
.. _csharp-update-operation:
7780

78-
Single Values
79-
-------------
80-
81-
The {+driver-short+} supports the field update operators described in the
82-
:manual:`{+mdb-server+} manual </reference/operator/update/#fields>`. To specify an
83-
update operation, call the corresponding method from the ``Builders.Update`` property.
84-
The following sections describe these methods in more detail.
85-
8681
Increment a Value
87-
~~~~~~~~~~~~~~~~~
82+
-----------------
8883

8984
To increment the value of a field by a specific amount, call the ``Builders.Update.Inc()``
9085
method. This method accepts the following parameters:
@@ -107,7 +102,7 @@ method. This method accepts the following parameters:
107102
**Data Type:** ``TField``
108103

109104
Set If Lower or Greater
110-
~~~~~~~~~~~~~~~~~~~~~~~
105+
-----------------------
111106

112107
To update the value of the field to a specified value, *but only if the specified value
113108
is greater than the current value of the field,* call the ``Builders.Update.Max()``
@@ -152,7 +147,7 @@ method. This method accepts the following parameters:
152147
**Data Type:** ``TField``
153148

154149
Multiply a Value
155-
~~~~~~~~~~~~~~~~
150+
---------------
156151

157152
To multiply the value of a field by a specific amount, call the ``Builders.Update.Mul()``
158153
method. This method accepts the following parameters:
@@ -175,7 +170,7 @@ method. This method accepts the following parameters:
175170
**Data Type:** ``TField``
176171

177172
Rename a Field
178-
~~~~~~~~~~~~~~
173+
--------------
179174

180175
To rename a field, call the ``Builders.Update.Rename()`` method. This method accepts the following parameters:
181176

@@ -197,7 +192,7 @@ To rename a field, call the ``Builders.Update.Rename()`` method. This method acc
197192
**Data Type:** ``string``
198193

199194
Set a Value
200-
~~~~~~~~~~~
195+
-----------
201196

202197
To set the value of a field to a specific value, call the ``Builders.Update.Set()``
203198
method. This method accepts the following parameters:
@@ -220,7 +215,7 @@ method. This method accepts the following parameters:
220215
**Data Type:** ``TField``
221216

222217
Unset a Field
223-
~~~~~~~~~~~~~
218+
-------------
224219

225220
To remove a field from a document, call the ``Builders.Update.Unset()`` method. This method accepts the following parameter:
226221

@@ -237,7 +232,7 @@ To remove a field from a document, call the ``Builders.Update.Unset()`` method.
237232
**Data Type:** ``Expression<Func<TDocument, TField>>``
238233

239234
Set on Insert
240-
~~~~~~~~~~~~~
235+
-------------
241236

242237
To set the value of a field only if the document is an upsert, call the ``Builders.Update.SetOnInsert()``
243238
method. This method accepts the following parameters:
@@ -260,7 +255,7 @@ method. This method accepts the following parameters:
260255
**Data Type:** ``TField``
261256

262257
Set the Current Date
263-
~~~~~~~~~~~~~~~~~~~~
258+
--------------------
264259

265260
To set the value of a field to the current date and time, call the ``Builders.Update.CurrentDate()``
266261
method. This method accepts the following parameters:

0 commit comments

Comments
 (0)