Skip to content

Commit f99047b

Browse files
authored
Docsp 24384 (#424)
* remove js-starter * page formatting
1 parent d2d8f67 commit f99047b

File tree

1 file changed

+30
-63
lines changed

1 file changed

+30
-63
lines changed

source/quick-start.txt

Lines changed: 30 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -39,88 +39,49 @@ in your development environment.
3939
For information on how to install Node.js and npm, see
4040
`downloading and installing Node.js and npm <https://docs.npmjs.com/downloading-and-installing-node-js-and-npm>`__.
4141

42-
Select the :guilabel:`Clone the Project` tab if you want to build your
43-
project from a premade dependency file or the :guilabel:`Create the Project`
44-
tab if you want to create the project dependency file yourself.
4542

46-
.. tabs::
43+
Create the Project
44+
~~~~~~~~~~~~~~~~~~
4745

48-
.. tab:: Clone the Project
49-
:tabid: clone the project
46+
First, in your shell, create a directory for your project:
5047

51-
Ensure you have git installed in your development environment.
48+
.. code-block:: bash
5249

53-
For information on how to install git, see `Git - Getting Started Guide <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`__.
50+
mkdir node_quickstart
5451

55-
Then, from your shell, clone the `js-starter repository
56-
<https://github.com/mongodb-university/js-starter>`__:
52+
Then, navigate into that directory:
5753

58-
.. code-block:: bash
54+
.. code-block:: bash
5955

60-
git clone --branch v{+version+} https://github.com/mongodb-university/js-starter.git
56+
cd node_quickstart
6157

62-
Next, navigate into the repository:
58+
Next, initialize your project:
6359

64-
.. code-block:: bash
60+
.. code-block:: bash
6561

66-
cd js-starter
62+
npm init -y
6763

68-
Then, install the {+driver-short+}:
64+
Add MongoDB as a Dependency
65+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
6966

70-
.. code-block:: bash
67+
Install the {+driver-short+}:
7168

72-
npm install
69+
.. code-block:: bash
7370

74-
This command performs the following actions:
71+
npm install mongodb@{+version+}
7572

76-
- Downloads and saves the ``mongodb`` package in a directory
77-
called ``node_modules``
78-
- Installs ``eslint``, which the project uses to identify and
79-
report issues in your code
80-
- Installs ``prettier``, which the project uses to format your code
73+
This command performs the following actions:
8174

82-
.. tab:: Create the Project
83-
:tabid: create the project
84-
85-
First, in your shell, create a directory for your project:
86-
87-
.. code-block:: bash
88-
89-
mkdir node_quickstart
90-
91-
Then, navigate into that directory:
92-
93-
.. code-block:: bash
94-
95-
cd node_quickstart
96-
97-
Next, initialize your project:
98-
99-
.. code-block:: bash
100-
101-
npm init -y
102-
103-
.. tip:: Why the -y?
104-
105-
If you specify the ``-y`` option in the command, npm uses the
106-
default values for your project settings. If you want to
107-
interactively select your project settings, omit the ``-y`` flag.
108-
109-
Then, install the {+driver-short+}:
110-
111-
.. code-block:: bash
112-
113-
npm install mongodb@{+version+}
114-
115-
This command performs the following actions:
116-
117-
- Downloads the ``mongodb`` package and the dependencies it requires
118-
- Saves the package in the ``node_modules`` directory
119-
- Records the dependency information in the ``package.json`` file
75+
- Downloads the ``mongodb`` package and the dependencies it requires
76+
- Saves the package in the ``node_modules`` directory
77+
- Records the dependency information in the ``package.json`` file
12078

12179
At this point, you are ready to use the {+driver-short+} with your
12280
application.
12381

82+
Create a MongoDB Cluster
83+
~~~~~~~~~~~~~~~~~~~~~~~~
84+
12485
.. procedure::
12586
:style: connected
12687

@@ -161,6 +122,12 @@ application.
161122

162123
Save your connection string to a safe location.
163124

125+
Connect to Your Application
126+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
127+
128+
.. procedure::
129+
:style: connected
130+
164131
.. step:: Create your Node.js Application
165132

166133
Create a file to contain your application called ``index.js`` in your
@@ -174,7 +141,7 @@ application.
174141

175142
// Replace the uri string with your connection string.
176143
const uri =
177-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&writeConcern=majority";
144+
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority";
178145

179146
const client = new MongoClient(uri);
180147

0 commit comments

Comments
 (0)