Skip to content

Commit c89bd25

Browse files
Revert "DOCSP-14047 add note about mongoshell to page"
This reverts commit c096754.
1 parent c096754 commit c89bd25

File tree

2 files changed

+14
-33
lines changed

2 files changed

+14
-33
lines changed

source/faq/fundamentals.txt

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -44,51 +44,35 @@ the columns in a relational database table.
4444
How do I create a database and a collection?
4545
--------------------------------------------
4646

47-
.. note::
48-
49-
You can enter the commands referenced in this FAQ by using
50-
the :binary:`MongoDB Shell <~bin.mongo>`. The MongoDB Shell is an
51-
interactive JavaScript interface to MongoDB. You can use the MongoDB
52-
Shell to query and update data as well as perform administrative
53-
operations.
54-
5547
If a database does not exist, MongoDB creates the database when you
5648
first store data for that database.
5749

5850
If a collection does not exist, MongoDB creates the collection when you
59-
first store data for that collection.
51+
first store data for that collection. [#explicit-creation]_
6052

6153
As such, you can switch to a non-existent database (``use <dbname>``)
6254
and perform the following operation:
6355

6456
.. code-block:: javascript
6557

66-
use myNewDB;
67-
68-
db.myNewCollection1.insertOne( { x: 1 } );
69-
db.myNewCollection2.createIndex( { a: 1 } );
58+
use myNewDB
7059

71-
- The :method:`db.collection.insertOne()` method creates
72-
the collection ``myNewCollection1`` if it does not already exist.
60+
db.myNewCollection1.insertOne( { x: 1 } )
61+
db.myNewCollection2.createIndex( { a: 1 } )
7362

74-
- The :method:`db.collection.createIndex()` method creates the index and
75-
the collection ``myNewCollection2`` if it does not already exist.
63+
The ``insert`` operation creates both the database ``myNewDB`` and the
64+
collection ``myNewCollection1`` if they do not already exist.
7665

77-
- If the ``myNewDb`` database did not exist, either the
78-
:method:`db.collection.createIndex()` method or
79-
:method:`db.collection.insertOne()` method would have created
80-
the ``myNewDb`` database automatically.
81-
82-
You can also create a collection explicitly using
83-
:method:`db.createCollection` method if you want to specify specific
84-
:ref:`options<create_collection_parameters>`, such as maximum size
85-
or document validation rules:
86-
87-
.. code-block:: javascript
66+
The ``createIndex`` operation, which occurs after the ``myNewDB`` has
67+
been created, creates the index and the collection ``myNewCollection2``
68+
if the collection does not exist. If ``myNewDb`` did not exist, the
69+
``createIndex`` operation would have also created the ``myNewDB``.
8870

89-
use myNewDB;
71+
.. [#explicit-creation]
9072

91-
db.createCollection("myNewCollection1");
73+
You can also create a collection explicitly using
74+
:method:`db.createCollection` if you want to specify specific
75+
options, such as maximum size or document validation rules.
9276

9377
.. _faq-schema-free:
9478

source/reference/method/db.createCollection.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ Definition
5757
}
5858
)
5959

60-
61-
.. _create_collection_parameters:
62-
6360
The :method:`db.createCollection()` method has the following parameters:
6461

6562

0 commit comments

Comments
 (0)