Skip to content

Commit 292320c

Browse files
Docsp 16491 typos fundamentals crud (#112)
1 parent acf720c commit 292320c

File tree

11 files changed

+49
-48
lines changed

11 files changed

+49
-48
lines changed

source/fundamentals/crud.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ CRUD Operations
1010
/fundamentals/crud/read-operations
1111
/fundamentals/crud/write-operations
1212
/fundamentals/crud/query-document
13-
/fundamentals/crud/bulk
1413
/fundamentals/crud/compound-operations
1514

1615
CRUD (Create, Read, Update, Delete) operations enable you to work with
@@ -24,6 +23,3 @@ data stored in MongoDB.
2423
Some operations combine aspects of read and write operations. See our
2524
guide on :doc:`compound operations </fundamentals/crud/compound-operations>`
2625
to learn more about these hybrid methods.
27-
28-
You can also perform multiple CRUD operations using bulk operations. See
29-
our guide on :doc:`bulk operations </fundamentals/crud/bulk>` to learn more.

source/fundamentals/crud/query-document.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Array operators query data based on the value or quantity of elements in
113113
an array field.
114114

115115
The following example uses the ``Filters.size()`` method to match
116-
documents where the size of ``vendor`` list is ``3`` in the
116+
documents where the size of the ``vendor`` list is ``3`` in the
117117
``paint_purchases`` collection:
118118

119119
.. literalinclude:: /includes/fundamentals/code-snippets/Query.java

source/fundamentals/crud/read-operations/cursor.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ MongoDB Java driver.
1818

1919
Read operations that return multiple documents do not immediately return
2020
all values matching the query. Because a query can potentially match
21-
large number of documents, we need to be able to access or store the
21+
a large number of documents, we need to be able to access or store the
2222
matched documents.
2323

2424
This page uses an initiating method, ``find()`` to show how to access
@@ -27,7 +27,7 @@ data from a :java-docs:`FindIterable
2727

2828
.. note::
2929

30-
The ways to access and store data mentioned below applies equally to
30+
The ways to access and store data mentioned below apply to
3131
other iterables such as an :java-docs:`AggregateIterable
3232
<apidocs/mongodb-driver-sync/com/mongodb/client/AggregateIterable.html>`.
3333

@@ -37,7 +37,7 @@ instance of a ``FindIterable``.
3737

3838
A ``FindIterable`` consists of documents matched by your search criteria
3939
and allows you to further specify which documents to see by setting
40-
parameters though methods.
40+
parameters through methods.
4141

4242
Terminal Methods
4343
----------------
@@ -152,8 +152,8 @@ iterate through results in a functional style:
152152

153153
.. warning::
154154

155-
Initiating methods implement the Iterable interface which allows you
156-
to iterate using iterator methods. Sometimes, we use an enhanced
155+
Initiating methods return objects that implement the ``Iterable`` interface which allows you
156+
to iterate through them using iterator methods. Sometimes, we use an enhanced
157157
for-each loop to iterate through results:
158158

159159
.. code-block:: java

source/fundamentals/crud/read-operations/retrieve.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Find Operation
4646

4747
Use the find operation to retrieve a subset of your existing data in
4848
MongoDB. You can specify what data to return including which documents
49-
to retrieve, in what order to retrieve them and how many to retrieve.
49+
to retrieve, in what order to retrieve them, and how many to retrieve.
5050

5151
To perform a find operation, call the ``find()`` method on an instance
5252
of a ``MongoCollection``. This method searches a collection for documents that
@@ -68,7 +68,7 @@ To address this scenario, the owner finds orders to match the criteria:
6868
:start-after: begin findExample
6969
:end-before: end findExample
7070

71-
For more information how to build filters, see our :doc:`Filters Builders
71+
For more information on how to build filters, see our :doc:`Filters Builders
7272
</fundamentals/builders/filters>` guide.
7373

7474
The following shows the output of the query specified above:
@@ -97,7 +97,7 @@ To perform an aggregate operation, call the ``aggregate()`` method on an
9797
instance of a ``MongoCollection``. This method accepts aggregation
9898
expressions to run in sequence. To perform aggregations, you can
9999
define aggregation stages that specify how to match documents, rename
100-
fields and group values. For more information, see our
100+
fields, and group values. For more information, see our
101101
:doc:`Aggregation </fundamentals/aggregation>` guide.
102102

103103
Example
@@ -144,14 +144,14 @@ streams, see the MongoDB server manual page on :manual:`Change Streams
144144
</changeStreams>`.
145145

146146
To open a change stream, call the ``watch()`` method on an instance of a
147-
``MongoCollection``, ``MongoDatabase`` or ``MongoClient``.
147+
``MongoCollection``, ``MongoDatabase``, or ``MongoClient``.
148148
You can pass an aggregation pipeline to this method to notify you as
149149
soon as a change occurs.
150150

151151
.. note::
152152

153153
Change streams don't support standalone MongoDB instances because
154-
they don't have an oplog.
154+
standalone MongoDB instances don't have an oplog.
155155

156156
The instance you call the ``watch()`` method on determines the scope of
157157
events which the change stream listens for. If you call ``watch()`` on a
@@ -165,7 +165,7 @@ Example
165165
~~~~~~~
166166

167167
The owner would like to receive notifications for when customers submit new
168-
orders or update their orders from thier :ref:`paint_order collection <retrieve-paint-order-collection>`.
168+
orders or update their orders in the :ref:`paint_order collection <retrieve-paint-order-collection>`.
169169

170170
To address this scenario, the owner:
171171

source/fundamentals/crud/read-operations/sort.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ within an aggregation pipeline. To sort your query results, use the
5454
aggregation pipeline, use the ``Aggregates.sort()`` static factory method. Both
5555
of these methods receive objects that implement the ``Bson`` interface as
5656
arguments. For more information, see our API Documentation for the
57-
:java-docs:`Bson interface <apidocs/bson/org/bson/conversions/Bson.html>`
57+
:java-docs:`Bson interface <apidocs/bson/org/bson/conversions/Bson.html>`.
5858

5959
You can use the ``sort()`` method of a ``FindIterable`` instance as follows:
6060

@@ -133,7 +133,7 @@ To specify an ascending sort, use the ``Sorts.ascending()`` static
133133
factory method. Pass the ``Sorts.ascending()`` method
134134
the name of the field you need to sort in ascending order.
135135

136-
You can use pass the ``sort()`` method the output of the ``Sorts.ascending()``
136+
You can pass the ``sort()`` method the output of the ``Sorts.ascending()``
137137
method to specify an ascending sort on a field as follows:
138138

139139
.. code-block:: java

source/fundamentals/crud/write-operations.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Write Operations
99
- :doc:`/fundamentals/crud/write-operations/change-a-document`
1010
- :doc:`/fundamentals/crud/write-operations/embedded-arrays`
1111
- :doc:`/fundamentals/crud/write-operations/upsert`
12+
- :doc:`/fundamentals/crud/write-operations/bulk`
1213

1314
.. toctree::
1415
:caption: Write Operations
@@ -18,3 +19,4 @@ Write Operations
1819
/fundamentals/crud/write-operations/change-a-document
1920
/fundamentals/crud/write-operations/embedded-arrays
2021
/fundamentals/crud/write-operations/upsert
22+
/fundamentals/crud/write-operations/bulk

source/fundamentals/crud/bulk.txt renamed to source/fundamentals/crud/write-operations/bulk.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Overview
1616
In this guide, you can learn how to use bulk operations in the
1717
MongoDB Java Driver.
1818

19-
To perform a create, replace, update or delete (CRUD) operation, you
20-
use their corresponding method. For example, to insert one document,
19+
To perform a create, replace, update, or delete operation,
20+
use its corresponding method. For example, to insert one document,
2121
update multiple documents, and delete one document in your collection,
22-
you use the ``insertOne()``, ``updateMany()`` and ``deleteOne()`` methods.
22+
use the ``insertOne()``, ``updateMany()`` and ``deleteOne()`` methods.
2323

2424
The ``MongoClient`` performs these operations by making a call for each
2525
operation to the database. You can reduce the number of calls to the
@@ -28,10 +28,10 @@ database to one by using bulk operations.
2828
Performing Bulk Operations
2929
--------------------------
3030

31-
Bulk operations consist of a large number of CRUD operations. To perform
32-
the bulk operation, pass a ``List`` of ``WriteModel`` documents to the
31+
Bulk operations consist of a large number of write operations. To perform
32+
a bulk operation, pass a ``List`` of ``WriteModel`` documents to the
3333
``bulkWrite()`` method. A ``WriteModel`` is a model that represents any
34-
of the CRUD operations.
34+
of the write operations.
3535

3636
The following sections show how to create and use each ``WriteModel``
3737
document. The examples in each section contain the following documents
@@ -60,7 +60,7 @@ Example
6060
```````
6161

6262
The following example creates an ``InsertOneModel`` for two documents
63-
where the ``_id`` is "3" and "4":
63+
where the ``_id`` values are "3" and "4":
6464

6565
.. literalinclude:: /includes/fundamentals/code-snippets/BulkWrite.java
6666
:language: java
@@ -87,7 +87,7 @@ where the ``_id`` is "3" and "4":
8787

8888
.. code-block:: shell
8989

90-
A MongoBulkWriteException occured with the following message:
90+
A MongoBulkWriteException occurred with the following message:
9191
Bulk write operation error on server sample-shard-00-02.pw0q4.mongodb.net:27017.
9292
Write errors: [BulkWriteError{index=0, code=11000, message='E11000 duplicate key
9393
error collection: crudOps.bulkWrite index: _id_ dup key: { _id: 1 }', details={}}].
@@ -104,7 +104,7 @@ Replace Operation
104104
~~~~~~~~~~~~~~~~~
105105

106106
To perform a replace operation, create a ``ReplaceOneModel`` specifying
107-
a query filter for document you want to replace with the replacement
107+
a query filter for the document you want to replace with the replacement
108108
document.
109109

110110
.. note::
@@ -185,7 +185,7 @@ match your query filter.
185185
.. note::
186186

187187
When performing a ``bulkWrite()``, the ``DeleteOneModel`` and
188-
``DeleteOneModel`` do not delete any documents if there are no matches
188+
``DeleteManyModel`` do not delete any documents if there are no matches
189189
to your query filter.
190190

191191
Example
@@ -251,8 +251,8 @@ Unordered Execution
251251

252252
You can also execute bulk operations in any order by specifying "false"
253253
to the ``order()`` method on ``BulkWriteOptions``. This means that
254-
all the bulk operations execute regardless if an error occurs and
255-
reports the errors at the end, if any.
254+
all the write operations execute regardless of errors and if any errors occur
255+
the bulk operation reports them at the end.
256256

257257
Adding to the example above, including the following specifies the bulk
258258
operations to execute in any order:
@@ -268,7 +268,7 @@ operations to execute in any order:
268268
Unordered bulk operations do not guarantee order of execution. The
269269
order may differ from the way you list them to optimize the runtime.
270270

271-
In the exampel above, if the ``bulkWrite()`` method decided to
271+
In the example above, if the ``bulkWrite()`` method decided to
272272
perform the insert operation after the update operation, nothing
273273
changes with the update operation because the document does not exist
274274
at that point in time. Your collection then contains the following

source/fundamentals/crud/write-operations/change-a-document.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ current inventory:
4040
Update
4141
------
4242

43-
Update operations can change the fields and values. They apply changes
43+
Update operations can change fields and values. They apply changes
4444
specified in an update document to one or more documents that match your
4545
query filter.
4646

@@ -61,6 +61,9 @@ You can call the ``updateOne()`` and ``updateMany()`` methods on a
6161
Update Operation Parameters
6262
~~~~~~~~~~~~~~~~~~~~~~~~~~~
6363

64+
The ``updateOne()`` and ``updateMany()`` methods both have the following
65+
parameters:
66+
6467
- ``query`` specifies a query filter with the criteria to match documents to update in your collection
6568
- ``updateDocument`` specifies the fields and values to change in the matching document or documents. For this example, we use the :doc:`Updates builder </fundamentals/builders/updates>` to create the update document.
6669

@@ -146,6 +149,8 @@ instance as follows:
146149
Replace Operation Parameters
147150
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148151

152+
The ``replaceOne()`` method has the following parameters:
153+
149154
- ``query`` specifies a query filter with the criteria to match a document to replace in your collection
150155
- ``replacementDocument`` specifies fields and values of a new ``Document`` object to replace in the matched document
151156

@@ -158,8 +163,8 @@ thought was 20 cans of pink paint is actually 25 cans of orange paint.
158163
To update the inventory, call the ``replaceOne()`` method specifying the
159164
following:
160165

161-
- A query filter that matches the ``color`` is "pink"
162-
- A replacement document that contains: ``color`` is "orange" and ``qty`` is "25"
166+
- A query filter that matches documents where the ``color`` is "pink"
167+
- A replacement document where the ``color`` is "orange" and the ``qty`` is "25"
163168

164169
.. literalinclude:: /includes/fundamentals/code-snippets/Update.java
165170
:language: java

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ deleted document:
133133
.. note::
134134

135135
If there are no matches to your query filter, no document gets
136-
deleted and the method returns null.
136+
deleted and the method returns ``null``.
137137

138138
The following shows the documents remaining in the ``paint_inventory``
139139
collection:

source/fundamentals/crud/write-operations/embedded-arrays.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,5 @@ The example above updates the original document to the following state:
182182
For more information about the methods and operators mentioned in this section,
183183
see the following resources:
184184

185-
- :manual:`Positional $[\<identifier\>] Operator </reference/operator/update/positional-filtered/>` Server Manual Entry
185+
- :manual:`Filtered Positional $[\<identifier\>] Operator </reference/operator/update/positional-filtered/>` Server Manual Entry
186186
- :java-docs:`inc() <apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#inc(java.lang.String,java.lang.Number)>` API Documentation

0 commit comments

Comments
 (0)