Skip to content

Commit 8ed2ba6

Browse files
committed
DOCS-617 minor edits to ensure <argument> have <> and spelling
1 parent b60f68f commit 8ed2ba6

File tree

2 files changed

+29
-30
lines changed

2 files changed

+29
-30
lines changed

draft/applications/create.txt

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Create
66

77
Of the four basic database operations (i.e. CRUD), *create* operations
88
are those that add new records or :term:`documents <document>` to a
9-
:term:`collection` in MongoDB. For general information related to
10-
document creation and other write operations, see
9+
:term:`collection` in MongoDB. For general information about write
10+
operations and the factors that affect their performance, see
1111
:ref:`/core/write-operations`; for documentation of the other CRUD
1212
operations, see the :doc:`/crud` page.
1313

@@ -48,8 +48,8 @@ Insert
4848
------
4949

5050
The :method:`insert() <db.collection.insert()>` is the primary method
51-
used to create documents into a MongoDB collection, and has the
52-
following syntax:
51+
to insert a document or documents into a MongoDB collection, and has
52+
the following syntax:
5353

5454
.. code-block:: javascript
5555

@@ -271,8 +271,8 @@ separate database call to check for the existence of a record before
271271
performing either an update or an insert operation. Typically update
272272
operations :doc:`update </applications/update>` existing documents, but
273273
in MongoDB, the :method:`update() <db.collection.update()>` operation
274-
can accept an ``upsert`` option as an argument. Upserts are a hybrid
275-
operation that use the ``query`` argument to determine the write
274+
can accept an ``<upsert>`` option as an argument. Upserts are a hybrid
275+
operation that use the ``<query>`` argument to determine the write
276276
operation:
277277

278278
- If the query returns a result, the upsert updates the matching
@@ -476,13 +476,14 @@ Save
476476
----
477477

478478
The :method:`save() <db.collection.save()>` method is a specialized
479-
upsert that use the ``_id`` field in document argument to determine
480-
whether to perform an insert or an update:
481-
482-
- If the document does not contain the ``_id`` field or contains an
483-
``_id`` field with a value not in the collection, the :method:`save()
484-
<db.collection.save()>` method performs an insert of the document.
485-
479+
upsert that use the ``_id`` field in the ``<document>`` argument to
480+
determine whether to perform an insert or an update:
481+
482+
- If the ``<document>`` argument does not contain the ``_id`` field or
483+
contains an ``_id`` field with a value not in the collection, the
484+
:method:`save() <db.collection.save()>` method performs an insert of
485+
the document.
486+
486487
- Otherwise, the :method:`save() <db.collection.save()>` method
487488
performs an update.
488489

@@ -496,7 +497,7 @@ following syntax:
496497
Consider the following examples that illustrate the use of the
497498
:method:`save() <db.collection.save()>` method to perform inserts:
498499

499-
- If the ``document`` does not contain the ``_id`` field, the
500+
- If the ``<document>`` does not contain the ``_id`` field, the
500501
:method:`save() <db.collection.save()>` method performs an insert.
501502
Refer to the :ref:`insert <crud-create-insert>` section for details
502503
of the insert operation of a document without an ``_id`` field.
@@ -520,7 +521,7 @@ Consider the following examples that illustrate the use of the
520521
]
521522
} )
522523

523-
- If the ``document`` contains an ``_id`` field but has a value not
524+
- If the ``<document>`` contains an ``_id`` field but has a value not
524525
found in the collection, the :method:`save() <db.collection.save()>`
525526
method performs an insert. Refer to the :ref:`insert
526527
<crud-create-insert>` section for details of the insert operation.

draft/applications/read.txt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Read
77
Of the four basic database operations (i.e. CRUD), read operation are
88
those that retrieve records or or :term:`documents <document>` from a
99
:term:`collection` in MongoDB. For general information about read
10-
operations and the factors that affect their performanace, see
10+
operations and the factors that affect their performance, see
1111
:ref:`/core/read-operations`; for documentation of the other CRUD
1212
operations, see the :doc:`/crud` page.
1313

@@ -188,12 +188,14 @@ Consider the following examples that illustrate the use of the
188188
} } } )
189189

190190
- If there is a ``<projection>`` argument, the :method:`find()
191-
<db.collection.find()>` method returns only those fields as
192-
specified in the projection to include or exclude:
191+
<db.collection.find()>` method returns only those fields as specified
192+
in the ``<projection>`` argument to include or exclude:
193193

194194
.. note:: The ``_id`` field is implicitly included in the
195-
projection, and in projections that explicitly include fields,
196-
``_id`` is the only field that you can explicitly exclude.
195+
``<projection>`` argument. In projections that explicitly include
196+
fields, ``_id`` is the only field that you can explicitly exclude.
197+
Otherwise, you cannot mix include field and exclude field
198+
specifications.
197199

198200
- The following operation finds all documents in the ``csbios``
199201
collection and returns only the ``name`` field, the ``contribs``
@@ -211,11 +213,6 @@ Consider the following examples that illustrate the use of the
211213

212214
db.csbios.find( { }, { name: 1, contribs: 1, _id: 0 } )
213215

214-
.. note::
215-
216-
The ``projection`` argument cannot contain both include and
217-
exclude specifications *except* for the exclusion of the ``_id``.
218-
219216
- The following operation finds the documents in the ``csbios``
220217
collection where the ``contribs`` field contains the element
221218
``OOP`` and returns all fields *except* the ``_id`` field, the
@@ -285,7 +282,7 @@ Except for the return value, :method:`findOne()
285282
examples that illustrate the use of the :method:`findOne()
286283
<db.collection.findOne()>` method:
287284

288-
- If there is no ``query`` argument, the :method:`findOne()
285+
- If there is no ``<query>`` argument, the :method:`findOne()
289286
<db.collection.findOne()>` method selects just one document from a
290287
collection.
291288

@@ -296,9 +293,9 @@ examples that illustrate the use of the :method:`findOne()
296293

297294
db.csbios.findOne()
298295

299-
- If there is a ``query`` argument, the :method:`findOne()
296+
- If there is a ``<query>`` argument, the :method:`findOne()
300297
<db.collection.findOne()>` method selects the first document from a
301-
collection that meets the ``query`` argument:
298+
collection that meets the ``<query>`` argument:
302299

303300
- The following operation returns the first matching document from
304301
the ``csbios`` collection where either the field ``first`` in the
@@ -311,8 +308,9 @@ examples that illustrate the use of the :method:`findOne()
311308
{ birth: { $lt: new Date('01/01/1945') } }
312309
] } )
313310

314-
- You can pass a projection to :method:`findOne()
315-
<db.collection.findOne()>` to control the fields included in the result set:
311+
- You can pass a ``<projection>`` argument to :method:`findOne()
312+
<db.collection.findOne()>` to control the fields included in the
313+
result set:
316314

317315
- The following operation finds a document in the ``csbios``
318316
collection and returns only the ``name`` field, the ``contribs``

0 commit comments

Comments
 (0)