@@ -20,12 +20,15 @@ Update Fields
2020Overview
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-
8681Increment a Value
87- ~~~~~~~~~~~~~~~~~
82+ -----------------
8883
8984To increment the value of a field by a specific amount, call the ``Builders.Update.Inc()``
9085method. This method accepts the following parameters:
@@ -107,7 +102,7 @@ method. This method accepts the following parameters:
107102 **Data Type:** ``TField``
108103
109104Set If Lower or Greater
110- ~~~~~~~~~~~~~~~~~~~~~~~
105+ -----------------------
111106
112107To update the value of the field to a specified value, *but only if the specified value
113108is 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
154149Multiply a Value
155- ~~~~~~~~~~~~~~~~
150+ ---------------
156151
157152To multiply the value of a field by a specific amount, call the ``Builders.Update.Mul()``
158153method. This method accepts the following parameters:
@@ -175,7 +170,7 @@ method. This method accepts the following parameters:
175170 **Data Type:** ``TField``
176171
177172Rename a Field
178- ~~~~~~~~~~~~~~
173+ --------------
179174
180175To 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
199194Set a Value
200- ~~~~~~~~~~~
195+ -----------
201196
202197To set the value of a field to a specific value, call the ``Builders.Update.Set()``
203198method. This method accepts the following parameters:
@@ -220,7 +215,7 @@ method. This method accepts the following parameters:
220215 **Data Type:** ``TField``
221216
222217Unset a Field
223- ~~~~~~~~~~~~~
218+ -------------
224219
225220To 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
239234Set on Insert
240- ~~~~~~~~~~~~~
235+ -------------
241236
242237To set the value of a field only if the document is an upsert, call the ``Builders.Update.SetOnInsert()``
243238method. This method accepts the following parameters:
@@ -260,7 +255,7 @@ method. This method accepts the following parameters:
260255 **Data Type:** ``TField``
261256
262257Set the Current Date
263- ~~~~~~~~~~~~~~~~~~~~
258+ --------------------
264259
265260To set the value of a field to the current date and time, call the ``Builders.Update.CurrentDate()``
266261method. This method accepts the following parameters:
0 commit comments