diff --git a/source/reference/command/convertToCapped.txt b/source/reference/command/convertToCapped.txt index 10974b4f5de..a97c65e4457 100644 --- a/source/reference/command/convertToCapped.txt +++ b/source/reference/command/convertToCapped.txt @@ -7,17 +7,34 @@ convertToCapped .. dbcommand:: convertToCapped The :dbcommand:`convertToCapped` command converts an existing, - non-capped collection to a :term:`capped collection`. Use the - following syntax: + non-capped collection to a :term:`capped collection`. + + The command has the following syntax: .. code-block:: javascript - {convertToCapped: "collection", size: 100 * 1024 } + {convertToCapped: , size: } + + This command coverts an existing ``collection`` to a capped + collection with a maximum size specified by the ``capped size`` in + bytes. + + During the conversion, the :dbcommand:`convertToCapped` command + exhibit the following behavior: + + - The documents in the original collection will be traversed in + :term:`$natural order ` and loaded into a new + capped collection. - This command coverts ``collection``, an existing collection, to a - capped collection, with a maximum size of 100 KB. This command - accepts the ``size`` and ``max`` options. See the - :dbcommand:`create` command for additional details. + - If the ``capped size`` specified for the capped collection is + smaller than the size of the original uncapped collection, then + the documents will be aged out of the collection based on + insertion order(First In, First Out). + + .. note:: + + The :dbcommand:`convertToCapped` command is not supported in a + sharded cluster. .. warning:: @@ -25,3 +42,6 @@ convertToCapped the original collection on the new collection. If you need indexes on this collection you will need to create these indexes after the conversion is complete. + + .. seealso:: :dbcommand:`create` +