@@ -1295,6 +1295,40 @@ Collections
12951295Administration
12961296~~~~~~~~~~~~~~
12971297
1298+ .. dbcommand:: touch
1299+
1300+ .. versionadded:: 2.2
1301+
1302+ The :dbcommand:`touch` command loads data from the data storage
1303+ layer into memory. :dbcommand:`touch` can load the data
1304+ (i.e. documents,) indexes or both documents and indexes. Use this
1305+ command to ensure that a collection, and/or its indexes, are in
1306+ memory before another operation. :dbcommand:`touch` command has the
1307+ following prototypical form:
1308+
1309+ .. code-block:: javascript
1310+
1311+ { touch: [collection], data: [boolean], index: [boolean] }
1312+
1313+ By default, ``data`` and ``index`` are false, and
1314+ :dbcommand:`touch` will provide no operation. For example to load
1315+ both the data and the index for a collection named ``records``, you
1316+ would use the following command in the :program:`mongo` shell:
1317+
1318+ .. code-block:: javascript
1319+
1320+ db.runCommand({ touch: "records", data: true, index: true })
1321+
1322+ :dbcommand:`touch` will not block operations on a program:`mongod`,
1323+ :and can run on :term:`secondary` members of replica sets.
1324+
1325+ .. note::
1326+
1327+ Using :dbcommand:`touch` to control or tweak what a
1328+ :program:`mongod` stores in memory may displace other records
1329+ data in memory and hinder performance. Use with caution in
1330+ production systems.
1331+
12981332.. dbcommand:: fsync
12991333
13001334 :dbcommand:`fsync` is an *administrative command* that forces the
0 commit comments