Skip to content

Commit 1d851d7

Browse files
author
Sam Kleinman
committed
DOCS-484: minor edits
1 parent 224b5e4 commit 1d851d7

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

source/reference/command/compact.txt

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ compact
3131
activity.
3232

3333
.. versionchanged:: 2.2 :dbcommand:`compact` blocks activities only
34-
for its database.
34+
for its database.
3535

3636
- ``paddingFactor: <factor>``
3737

@@ -55,8 +55,9 @@ compact
5555

5656
.. versionadded:: v2.2
5757

58-
It is recommended that you always add at least 100 bytes of padding,
59-
and at least 10% of the doc size.
58+
In production deployments, collections should always have at least
59+
100 bytes of padding, and generally have a padding factor that is
60+
10% of the average document size.
6061

6162
.. code-block:: javascript
6263

@@ -67,19 +68,20 @@ compact
6768
Always have an up-to-date backup before performing server
6869
maintenance such as the :dbcommand:`compact` operation.
6970

70-
Note the following command behaviors:
71+
Note the following behaviors:
7172

7273
- :dbcommand:`compact` blocks all other activity (in v2.2, blocks
7374
activities only for its database.) You may view the intermediate
7475
progress either by viewing the the :program:`mongod` log file, or
7576
by running the :method:`db.currentOp()` in another shell instance.
7677

7778
- :dbcommand:`compact` removes any :term:`padding factor` in the
78-
collection if the command is run without either the
79+
collection when issued without either the
7980
``paddingFactor`` option or the ``paddingByte`` option. This may
80-
impact performance if the documents grow regularly. However, the
81-
existing paddingFactor statistics is kept for the collection and
82-
will be used for future inserts.
81+
impact performance if the documents grow regularly. However,
82+
:dbcommand:`compact` retains
83+
existing paddingFactor statistics for the collection that MongoDB
84+
will use to calculate the padding factor for future inserts.
8385

8486
- :dbcommand:`compact` generally uses less disk space than
8587
:dbcommand:`repairDatabase` and is faster. However,the
@@ -90,14 +92,14 @@ compact
9092
- If you kill the operation by running the :method:`db.killOp(opid) <db.killOP()>` or
9193
restart the server before it has finished:
9294

93-
+ If you have journaling enabled, your data will
95+
- If you have journaling enabled, your data will
9496
be safe. However, you may have to manually rebuild the indexes.
9597

96-
+ If you do not have journaling enabled, the :dbcommand:`compact`
98+
- If you do not have journaling enabled, the :dbcommand:`compact`
9799
command is much less safe, and there are no guarantees made about
98100
the safety of your data in the event of a shutdown or a kill.
99101

100-
+ In either case, much of the existing free space in the
102+
- In either case, much of the existing free space in the
101103
collection may become un-reusable. In this scenario, you should
102104
rerun the compaction to completion to restore the use of this free
103105
space.
@@ -119,16 +121,16 @@ compact
119121
- :dbcommand:`compact` commands do not replicate. When running
120122
compact on a :term:`replica set`:
121123

122-
+ Compact each member separately.
124+
- Compact each member separately.
123125

124-
+ Ideally, compaction runs on a secondary. (See option
126+
- Ideally, compaction runs on a secondary. (See option
125127
``force:true`` above for information regarding compacting the
126128
primary.)
127129

128-
+ If :dbcommand:`compact` runs on a secondary, the secondary will
129-
go into "recovering" state automatically to prevent reads from
130-
being routed to it during compation. Once the compaction is
131-
finished, it will automatically return to secondary state.
130+
- If :dbcommand:`compact` runs on a secondary, the secondary will
131+
enter a "recovering" state to prevent clients from directing
132+
treads to it during compaction. Once the compaction
133+
finishes the secondary will automatically return to secondary state.
132134

133135
You may refer to the "`partial script for automating step down
134136
and compaction
@@ -148,4 +150,4 @@ compact
148150

149151
.. seealso::
150152

151-
:dbcommand:`repairDatabase`
153+
:dbcommand:`repairDatabase`

source/reference/operator/not.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ $not
2424
- the ``price`` field value is less than or equal to ``1.99`` **or**
2525
- the ``price`` field does not exist
2626

27-
Notice that ``{ $not: { $gt: 1.99 } }`` is different from the
28-
:operator:`$lte` operator. ``{ $lt: 1.99 }`` returns *only* the
29-
documents where ``price`` field exists and its value is less than or
30-
equal to ``1.99``.
27+
``{ $not: { $gt: 1.99 } }`` is different from the :operator:`$lte`
28+
operator. ``{ $lt: 1.99 }`` returns *only* the documents where
29+
``price`` field exists and its value is less than or equal to
30+
``1.99``.
3131

3232
Remember that the :operator:`$not` operator only affects *other
3333
operators* and cannot check fields and documents independently. So,
@@ -70,4 +70,4 @@ $not
7070
method:`find() <db.collection.find()>`, :method:`update()
7171
<db.collection.update()>`, :operator:`$set`, :operator:`$gt`,
7272
:operator:`$regex`, :api:`PyMongo <python\current>`,
73-
:term:`driver`.
73+
:term:`driver`.

source/reference/operator/or.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ $or
3939
db.inventory.update( { $or: [ { price:10.99 }, { "carrier.state": "NY"} ] }, { $set: { sale: true } } )
4040

4141
This :method:`update() <db.collection.update()>` operation will set
42-
the value of the ``sale`` field in the documents where
43-
44-
to update a single document in ``inventory`` where:
42+
the value of the ``sale`` field in the documents in the
43+
``inventory`` collection where:
4544

4645
- the ``price`` field value equals ``10.99`` **or**
4746
- the ``carrier`` embedded document contains a field ``state`` whose

0 commit comments

Comments
 (0)