Skip to content

Commit a333e4e

Browse files
committed
DOCS-617 field order, write concern, and minor edits
1 parent 2170e48 commit a333e4e

File tree

8 files changed

+56
-50
lines changed

8 files changed

+56
-50
lines changed

draft/applications/create.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ the create operation:
3131

3232
MongoDB v2.2 has a 16 megabytes limit on document size.
3333

34-
.. include:: /includes/note-write-concerns.rst
35-
3634
.. include:: /includes/warning-document-field-name-restrictions.rst
3735

36+
.. note::
37+
38+
.. include:: /includes/fact-write-concerns.rst
39+
3840
.. _crud-create-insert:
3941

4042
Insert

draft/applications/delete.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Delete operation removes documents from a :term:`collection`. MongoDB
88
provides the :ref:`remove() <crud-delete-remove>` method to perform
99
delete operations.
1010

11-
.. include:: /includes/note-write-concerns.rst
11+
.. note::
12+
13+
.. include:: /includes/fact-write-concerns.rst
1214

1315
.. _crud-delete-remove:
1416

draft/applications/update.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ methods to perform update operations:
1212

1313
- :ref:`save <crud-update-save>`
1414

15-
.. include:: /includes/note-write-concerns.rst
15+
.. note::
16+
17+
- .. include:: /includes/fact-update-field-order.rst
18+
19+
- .. include:: /includes/fact-write-concerns.rst
1620

1721
.. _crud-update-update:
1822

draft/core/read-operations.txt

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ iterates over the result set of matching :term:`documents` in a collection.
2323

2424
.. index:: read operations; query
2525
.. index:: query; read operations
26-
.. _read-operations-query-operations:
26+
.. _read-operations-query-operators:
2727

28-
Read Operations
28+
Read Operators
2929
---------------
3030

3131
In the :program:`mongo` shell the :method:`find()
@@ -46,21 +46,19 @@ syntax:
4646
in the :program:`mongo` shell to list the current collections in the
4747
database.
4848

49-
- Queries in MongoDB have a JSON-like syntax, and take the form of a
50-
:term:`document` using a collection of :doc:`/reference/operators`
51-
query operators to describe query parameters.
49+
- The ``<query>`` argument specifies the selection criteria in the form
50+
of JSON-like :doc:`core/documents` that use a set of
51+
:doc:`/reference/operators` to specify the query conditions.
5252

53-
The ``<query>`` argument of the :method:`find()
54-
<db.collection.find()>` method holds this query document. A query,
55-
without a query document will return all documents in the
56-
collection.
53+
The :method:`find() <db.collection.find()>` method without a query
54+
argument will return all documents in the collection.
5755

58-
- The ``<projection>`` argument describes describes the result or
59-
return set in the form of a document. Projections specify or limit
56+
- The ``<projection>`` argument describes the result set
57+
in the form of a document. Projections specify or limit
6058
the fields to return.
6159

6260
Without a projection the operation will return all
63-
fields of all documents, specify a projection if your documents are
61+
fields of all documents. Specify a projection if your documents are
6462
larger, or when your application only needs a subset of available
6563
fields.
6664

@@ -158,7 +156,7 @@ query. Consider the following example query operations using the
158156

159157
db.inventory.find( { tags: "fruit" } )
160158

161-
MongoDB provides a full complement of query selection operators such
159+
MongoDB provides a full range of query selection operators such
162160
as the :operator:`$lt` operator and the :operator:`$or`
163161
operator. Refer to the :doc:`/reference/operators` document for the
164162
complete list of query selection operators.
@@ -168,13 +166,13 @@ complete list of query selection operators.
168166
Projection Argument
169167
~~~~~~~~~~~~~~~~~~~
170168

171-
The :term:`projection` specification, limits the fields to return for
172-
all matching. By narrowing the fields to return, projections can
173-
minimize network transit costs and the costs of deserializing document
174-
in the applications. In the ``<projection>`` argument, you can either
175-
specify the fields to include (``field:1``) or specify the fields to
176-
exclude (``field:0``). The ``_id`` field is implicitly included,
177-
unless explicitly excluded.
169+
The :term:`projection` specification limits the fields to return for
170+
all matching documents. By narrowing the fields to return, projections
171+
can minimize network transit costs and the costs of deserializing
172+
document in the applications. In the ``<projection>`` argument, you can
173+
either specify the fields to include (``field:1``) or specify the
174+
fields to exclude (``field:0``). The ``_id`` field is implicitly
175+
included, unless explicitly excluded.
178176

179177
.. note::
180178

@@ -217,9 +215,9 @@ Consider the following projection specifications, in the
217215

218216
db.inventory.find( { type: 'food' }, { type:0 } )
219217

220-
MongoDB also provides the following projection operators, that allow
221-
richer projection specifications for fields that hold arrays. Refer to
222-
the operator documentation for the :projection:`$elemMatch` and
218+
MongoDB also provides the projection operators that allow richer
219+
projection specifications for fields that hold arrays. Refer to the
220+
operator documentation for the :projection:`$elemMatch` and
223221
:projection:`$slice` operators.
224222

225223
.. _read-operations-indexing:
@@ -228,10 +226,10 @@ Indexes
228226
-------
229227

230228
Indexes improve the efficiency of read operations by reducing the work
231-
associated with fulfilling queries, by building a special structure
232-
and maintain that structure when inserting or modifying
233-
documents. These indexes support specific queries, sort operations,
234-
and allow for more efficient storage utilization.
229+
associated with fulfilling queries, by building a special structure and
230+
maintaining that structure during insert and update operations. These
231+
indexes support specific queries and sort operations, and allow for
232+
more efficient storage utilization.
235233

236234
Create indexes using the :method:`db.collection.ensureIndex{)` method
237235
in the :program:`mongo` shell, as in the following prototype
@@ -286,8 +284,8 @@ To improve the performance of the query, create an index on the
286284

287285
db.inventory.ensureIndex( { type: 1 } )
288286

289-
Compare the performance of the previous read operation, but now
290-
executed with the newly created index:
287+
Compare the performance of the previous read operation now executed
288+
with the newly created index:
291289

292290
.. code-block:: javascript
293291

@@ -434,7 +432,7 @@ following methods and commands:
434432

435433
- :method:`group()`
436434

437-
- :dbcommand:`mapReduce() <mapreduce>` (See also :wiki:`MapReduce`.)
435+
- :dbcommand:`mapReduce() <mapreduce>`
438436

439437
.. index:: read operation; architecture
440438
.. _read-operations-architecture:
@@ -444,12 +442,6 @@ Architecture
444442

445443
.. index:: read operation; connection pooling
446444
.. index:: connection pooling; read operations
447-
.. _read-operations-connection-pooling:
448-
449-
Connection Pooling
450-
~~~~~~~~~~~~~~~~~~
451-
452-
.. TODO
453445

454446
Sharded Clusters
455447
~~~~~~~~~~~~~~~~

draft/core/write-operations.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ Write Operations
44

55
.. default-domain:: mongodb
66

7-
Write operations create, update, and delete data in MongoDB databases.
8-
MongoDB databases store data as :term:`documents <document>` in
9-
:term:`collections <collection>`.
7+
Write operations create, update, and delete data. MongoDB stores data
8+
as :term:`documents <document>` in :term:`collections <collection>`.
109

1110
This section of the manual describes how MongoDB performs write
1211
operations and how different factors affect the efficiency of those
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
When performing update operations that increase the document size
2+
beyond the allocated space for that document, the update operation
3+
relocates the document on disk and orders the document fields
4+
alphanumerically.
5+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
By default, all write operations will issue a :dbcommand:`getLastError`
2+
command to confirm the result of the write operation:
3+
4+
.. code-block:: javascript
5+
6+
{ getLastError: 1 }
7+
8+
Refer to the documentation on :ref:`write concern <write-concern>` and
9+
:doc:`/applications/write-operations` for more information.

source/includes/note-write-concerns.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)