Skip to content

Commit d942db0

Browse files
committed
AS PR fixes 1
1 parent 843f43a commit d942db0

File tree

2 files changed

+48
-17
lines changed

2 files changed

+48
-17
lines changed

snooty.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ patch-version-number = "{+version-number+}.0"
2525
mdb-server = "MongoDB Server"
2626
stable-api = "Stable API"
2727
api = "https://mongodb.github.io/mongo-java-driver/{+version-number+}/apidocs/mongodb-driver-kotlin-sync"
28-
core-api = "https://mongodb.github.io/mongo-java-driver/{+version-number+}/apidocs/mongodb-driver-core/"
28+
core-api = "https://mongodb.github.io/mongo-java-driver/{+version-number+}/apidocs/mongodb-driver-core"

source/write/insert.txt

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,11 @@ The following example inserts a list of documents into the
121121
Modify Insert Behavior
122122
----------------------
123123

124-
The ``insertOne()`` method optionally accepts a parameter
125-
that sets options to configure the insert operation.
124+
The ``insertOne()`` method optionally accepts an ``InsertOneOptions``
125+
parameter that sets options to configure the insert operation.
126126
If you don't specify any options, the driver performs the insert
127-
operation with default settings.
127+
operation with default settings. Pass options as the last parameter to
128+
the ``insertOne()`` method.
128129

129130
The following table describes the setter methods that you can use to
130131
configure an ``InsertOneOptions`` instance:
@@ -133,7 +134,7 @@ configure an ``InsertOneOptions`` instance:
133134
:widths: 30 70
134135
:header-rows: 1
135136

136-
* - Property
137+
* - Method
137138
- Description
138139

139140
* - ``bypassDocumentValidation()``
@@ -149,16 +150,28 @@ configure an ``InsertOneOptions`` instance:
149150
You can set the preceding settings on the ``insertMany()`` method
150151
by configuring an ``InsertManyOptions`` instance. You can also use the
151152
``ordered()`` method setter method to specify the order in which the driver
152-
inserts documents into MongoDB. If set to ``true``, the driver sends documents to the
153-
server in the order provided. If an error occurs, the driver and server
154-
cancel all remaining insert operations. The driver performs ordered
155-
inserts by default.
153+
inserts documents into MongoDB:
154+
155+
.. list-table::
156+
:widths: 30 70
157+
:header-rows: 1
158+
159+
* - Method
160+
- Description
161+
162+
* - ``ordered()``
163+
- | If set to ``true``, the driver sends documents to the
164+
server in the order provided. If an error occurs, the driver
165+
cancels all remaining insert operations.
166+
| Defaults to ``true``.
167+
168+
Pass options as the last parameter to the ``insertMany()`` method.
156169

157170
Modify Insert Example
158171
~~~~~~~~~~~~~~~~~~~~~
159172

160-
The following code creates options and uses the ``bypassDocumentValidation()`` method to
161-
ignore document validation rules. Then, the example uses the
173+
The following code uses the ``bypassDocumentValidation()`` method to
174+
set the option to ignore document validation rules. Then, the example uses the
162175
``insertMany()`` method to add new documents to the ``restaurants``
163176
collection.
164177

@@ -178,16 +191,34 @@ the ``insertMany()`` method returns an ``InsertManyResult`` instance.
178191
You can use the following methods to retrieve information from
179192
an ``InsertOneResult`` instance:
180193

181-
- ``getInsertedId()``, which indicates the ``_id`` value of the inserted document
182-
- ``wasAcknowledged()``, which returns ``true`` if the server
183-
acknowledges the result
194+
.. list-table::
195+
:widths: 30 70
196+
:header-rows: 1
197+
198+
* - Method
199+
- Description
200+
201+
* - ``getInsertedId()``
202+
- Indicates the ``_id`` value of the inserted document.
203+
204+
* - ``wasAcknowledged()``
205+
- Returns ``true`` if the server acknowledges the result.
184206

185207
You can use the following methods to retrieve information from
186208
an ``InsertOneResult`` instance:
187209

188-
- ``getInsertedIds()``, which indicates the ``_id`` values of the inserted documents
189-
- ``wasAcknowledged()``, which returns ``true`` if the server
190-
acknowledges the result
210+
.. list-table::
211+
:widths: 30 70
212+
:header-rows: 1
213+
214+
* - Method
215+
- Description
216+
217+
* - ``getInsertedIds()``
218+
- Indicates the ``_id`` values of the inserted documents.
219+
220+
* - ``wasAcknowledged()``
221+
- Returns ``true`` if the server acknowledges the result.
191222

192223
.. note::
193224

0 commit comments

Comments
 (0)