diff --git a/source/tutorial/getting-started.txt b/source/tutorial/getting-started.txt index 7196f25bb51..107c5df3131 100644 --- a/source/tutorial/getting-started.txt +++ b/source/tutorial/getting-started.txt @@ -16,7 +16,7 @@ The tutorial assumes that you're running MongoDB on a Linux or OS X operating system and that you have a running database server; MongoDB does support Windows and provides a Windows distribution with identical operation. For instructions on installing MongoDB and -starting the database server see the appropriate :doc:`installation +starting the database server, see the appropriate :doc:`installation ` document. .. contents:: This tutorial addresses the following aspects of MongoDB use: @@ -27,7 +27,7 @@ starting the database server see the appropriate :doc:`installation Connect to a Database --------------------- -In this section you connect to the database server, which runs as +In this section, you connect to the database server, which runs as :program:`mongod`, and begin using the :program:`mongo` shell to select a logical database within the database instance and access the help text in the :program:`mongo` shell. @@ -51,9 +51,9 @@ options. Select a Database ~~~~~~~~~~~~~~~~~ -After starting the :program:`mongo` shell your session will use the -``test`` database for context, by default. At any time issue the -following operation at the :program:`mongo` to report the current +After starting the :program:`mongo` shell, your session will use the +``test`` database for context, by default. At any time, issue the +following operation at the :program:`mongo` shell to report the current database: .. code-block:: javascript @@ -63,13 +63,13 @@ database: ``db`` returns the name of the current database. 1. From the :program:`mongo` shell, display the list of - databases with the following operation: + databases, with the following operation: .. code-block:: javascript show dbs -#. Switch to a new database named ``mydb`` with the following +#. Switch to a new database named ``mydb``, with the following operation: .. code-block:: javascript @@ -78,7 +78,7 @@ database: #. Confirm that your session has the ``mydb`` database as context, using the ``db`` operation, which returns the name of the current - database as follows: + database, as follows: .. code-block:: javascript @@ -96,7 +96,7 @@ for inserting data. Display ``mongo`` Help ~~~~~~~~~~~~~~~~~~~~~~ -At any point you can access help for the :program:`mongo` shell using +At any point, you can access help for the :program:`mongo` shell using the following operation: .. code-block:: javascript @@ -126,14 +126,14 @@ Insert Individual Documents ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. From the :program:`mongo` shell, confirm that the current context - is the ``mydb`` database with the following operation: + is the ``mydb`` database, with the following operation: .. code-block:: javascript db #. If :program:`mongo` does not return ``mydb`` for the previous - operation, set the context to the ``mydb`` database with the + operation, set the context to the ``mydb`` database, with the following operation: .. code-block:: javascript @@ -149,7 +149,7 @@ Insert Individual Documents k = { x : 3 } #. Insert the ``j`` and ``k`` documents into the collection - ``things`` with the following sequence of operations: + ``things``, with the following sequence of operations: .. code-block:: javascript @@ -159,7 +159,7 @@ Insert Individual Documents When you insert the first document, the :program:`mongod` will create both the ``mydb`` database and the ``things`` collection. -#. Confirm that the collection named ``things`` exists using +#. Confirm that the collection named ``things`` exists, using the following operation: .. code-block:: javascript @@ -171,8 +171,8 @@ Insert Individual Documents collection is ``things``. All :program:`mongod` databases also have a :data:`system.indexes <.system.indexes>` collection. -#. Confirm that the documents exist in the collection ``things`` by - issuing query on the ``things`` collection. Using the +#. Confirm that the documents exist in the collection ``things``, by + issuing a query on the ``things`` collection, using the :method:`find() ` method in an operation that resembles the following: @@ -198,7 +198,7 @@ Insert Multiple Documents Using a For Loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. From the :program:`mongo` shell, add more documents to the ``things`` - collection using the following ``for`` loop: + collection, using the following ``for`` loop: .. code-block:: javascript @@ -240,7 +240,7 @@ Insert Multiple Documents Using a For Loop .. _getting-started-cursor-exhaustion: #. The :method:`~db.collection.find()` returns a cursor. To iterate - the cursor and return more documents use the ``it`` operation in + the cursor and return more documents, use the ``it`` operation in the :program:`mongo` shell. The :program:`mongo` shell will exhaust the cursor, and return the following documents: @@ -275,7 +275,7 @@ For comprehensive documentation on cursors, see Iterate over the Cursor with a Loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1. In the MongoDB JavaScript shell, query the ``things`` collection +1. In the :program:`mongo` shell, query the ``things`` collection and assign the resulting cursor object to the ``c`` variable: .. code-block:: javascript @@ -293,8 +293,8 @@ Iterate over the Cursor with a Loop The ``next()`` method returns the next document. The ``printjson()`` method renders the document in a JSON-like format. - The result of this operation follows, although if the - :doc:`ObjectId ` values will be unique: + The result of this operation follows. Your + :doc:`ObjectId ` values will be different. .. code-block:: javascript @@ -382,7 +382,7 @@ To query for specific documents, do the following: db.things.find( { name : "mongo" } ) - MongoDB returns one document that fits this criteria. The + MongoDB returns one document that fits this criteria. Your :doc:`ObjectId ` value will be different: .. code-block:: javascript @@ -426,7 +426,7 @@ To query for specific documents, do the following: #. Query for all documents where ``x`` has a value of ``4``, as in the - previous query, but only return only the value of ``j``. MongoDB + previous query, but return only the value of ``j``. MongoDB will also return the ``_id`` field, unless explicitly excluded. To do this, you add the ``{ j : 1 }`` document as the :term:`projection` in the second parameter to :method:`find() @@ -484,7 +484,7 @@ For more information on querying for documents, see the Limit the Number of Documents in the Result Set ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You can constrain the size of the result set to increase performance by +To increase perfomance, you can constrain the size of the result by limiting the amount of data your application must receive over the network.