Skip to content

Commit 9006424

Browse files
corrections in First mongo app (#35163)
* Closes #35134 * Closes #35133 * Closes #35131 * fix invalid path
1 parent 786bccc commit 9006424

File tree

5 files changed

+19
-23
lines changed

5 files changed

+19
-23
lines changed

aspnetcore/tutorials/first-mongo-app.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ Enable MongoDB and MongoDB Shell access from anywhere on the development machine
5050

5151
1. Download and Install MongoDB Shell:
5252
* macOS/Linux: Choose a directory to extract the MongoDB Shell to. Add the resulting path for `mongosh` to the `PATH` environment variable.
53-
* Windows: MongoDB Shell (mongosh.exe) is installed at *C:\Users\<user>\AppData\Local\Programs\mongosh*. Add the resulting path for `mongosh.exe` to the `PATH` environment variable.
53+
* Windows: MongoDB Shell (mongosh.exe) is installed at *C:\\Users\\\<user>\\AppData\\Local\\Programs\\mongosh*. Add the resulting path for `mongosh.exe` to the `PATH` environment variable.
5454
1. Download and Install MongoDB:
5555
* macOS/Linux: Verify the directory that MongoDB was installed at, usually in */usr/local/mongodb*. Add the resulting path for `mongodb` to the `PATH` environment variable.
56-
* Windows: MongoDB is installed at *C:\\Program Files\MongoDB* by default. Add *C:\\Program Files\\MongoDB\\Server\\\<version_number>\\bin* to the `PATH` environment variable.
56+
* Windows: MongoDB is installed at *C:\\Program Files\\MongoDB* by default. Add *C:\\Program Files\\MongoDB\\Server\\\<version_number>\\bin* to the `PATH` environment variable.
5757
1. Choose a Data Storage Directory: Select a directory on your development machine for storing data. Create the directory if it doesn't exist. The MongoDB Shell doesn't create new directories:
5858
* macOS/Linux: For example, `/usr/local/var/mongodb`.
5959
* Windows: For example, `C:\\BooksData`.
@@ -65,14 +65,13 @@ Enable MongoDB and MongoDB Shell access from anywhere on the development machine
6565

6666
Use the previously installed MongoDB Shell in the following steps to create a database, make collections, and store documents. For more information on MongoDB Shell commands, see [`mongosh`](https://docs.mongodb.com/mongodb-shell/run-commands/).
6767

68-
1. Open a MongoDB command shell instance by launching `mongosh.exe`.
69-
1. In the command shell, connect to the default test database by running the following command:
68+
1. Open a MongoDB command shell instance by launching `mongosh.exe`, or by running the following command in the command shell:
7069

7170
```console
7271
mongosh
7372
```
7473

75-
1. Run the following command in the command shell:
74+
1. In the command shell connect to the default test database by running:
7675

7776
```console
7877
use BookStore
@@ -268,7 +267,7 @@ The preceding web API controller:
268267

269268
1. Build and run the app.
270269

271-
1. Navigate to `https://localhost:<port>/api/books`, where `<port>` is the automatically assigned port number for the app, to test the controller's parameterless `Get` action method, select **Try it out** > **Execute**. A JSON response similar to the following is displayed:
270+
1. Navigate to `https://localhost:<port>/api/books`, where `<port>` is the automatically assigned port number for the app, to test the controller's parameterless `Get` action method. A JSON response similar to the following is displayed:
272271

273272
```json
274273
[
@@ -334,7 +333,7 @@ To satisfy the preceding requirements, make the following changes:
334333

335334
## Additional resources
336335

337-
* [View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mongo-app/samples) ([how to download](xref:index#how-to-download-a-sample))
336+
* [View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mongo-app/samples/8.x/BookStoreApi) ([how to download](xref:index#how-to-download-a-sample))
338337
* <xref:web-api/index>
339338
* <xref:web-api/action-return-types>
340339
* [Create a web API with ASP.NET Core](/training/modules/build-web-api-aspnet-core/)

aspnetcore/tutorials/first-mongo-app/includes/first-mongo-app3-5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ To satisfy the preceding requirements, make the following changes:
354354

355355
For more information on building ASP.NET Core web APIs, see the following resources:
356356

357+
* [View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mongo-app/samples/3.x/SampleApp) ([how to download](xref:index#how-to-download-a-sample))
357358
* [YouTube version of this article](https://www.youtube.com/watch?v=7uJt_sOenyo&feature=youtu.be)
358359
* <xref:web-api/index>
359360
* <xref:web-api/action-return-types>

aspnetcore/tutorials/first-mongo-app/includes/first-mongo-app6.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ Enable MongoDB and Mongo DB Shell access from anywhere on the development machin
4545

4646
Use the previously installed MongoDB Shell in the following steps to create a database, make collections, and store documents. For more information on MongoDB Shell commands, see [`mongosh`](https://docs.mongodb.com/mongodb-shell/run-commands/).
4747

48-
1. Open a MongoDB command shell instance by launching `mongosh.exe`.
49-
1. In the command shell connect to the default test database by running the following command:
48+
1. Open a MongoDB command shell instance by launching `mongosh.exe`, or by running the following command in the command shell:
5049

5150
```console
5251
mongosh
5352
```
5453

55-
1. Run the following command in the command shell:
54+
1. In the command shell connect to the default test database by running:
5655

5756
```console
5857
use BookStore
@@ -320,7 +319,7 @@ To satisfy the preceding requirements, make the following changes:
320319

321320
## Additional resources
322321

323-
* [View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mongo-app/samples) ([how to download](xref:index#how-to-download-a-sample))
322+
* [View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mongo-app/samples/6.x/BookStoreApi) ([how to download](xref:index#how-to-download-a-sample))
324323
* <xref:web-api/index>
325324
* <xref:web-api/action-return-types>
326325
* [Create a web API with ASP.NET Core](/training/modules/build-web-api-aspnet-core/)

aspnetcore/tutorials/first-mongo-app/includes/first-mongo-app7.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ Enable MongoDB and Mongo DB Shell access from anywhere on the development machin
4545

4646
Use the previously installed MongoDB Shell in the following steps to create a database, make collections, and store documents. For more information on MongoDB Shell commands, see [`mongosh`](https://docs.mongodb.com/mongodb-shell/run-commands/).
4747

48-
1. Open a MongoDB command shell instance by launching `mongosh.exe`.
49-
1. In the command shell connect to the default test database by running the following command:
48+
1. Open a MongoDB command shell instance by launching `mongosh.exe`, or by running the following command in the command shell:
5049

5150
```console
5251
mongosh
5352
```
5453

55-
1. Run the following command in the command shell:
54+
1. In the command shell connect to the default test database by running:
5655

5756
```console
5857
use BookStore
@@ -321,7 +320,7 @@ To satisfy the preceding requirements, make the following changes:
321320

322321
## Additional resources
323322

324-
* [View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mongo-app/samples) ([how to download](xref:index#how-to-download-a-sample))
323+
* [View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mongo-app/samples/7.x/BookStoreApi) ([how to download](xref:index#how-to-download-a-sample))
325324
* <xref:web-api/index>
326325
* <xref:web-api/action-return-types>
327326
* [Create a web API with ASP.NET Core](/training/modules/build-web-api-aspnet-core/)

aspnetcore/tutorials/first-mongo-app/includes/first-mongo-app8.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ Enable MongoDB and MongoDB Shell access from anywhere on the development machine
3737

3838
1. Download and Install MongoDB Shell:
3939
* macOS/Linux: Choose a directory to extract the MongoDB Shell to. Add the resulting path for `mongosh` to the `PATH` environment variable.
40-
* Windows: MongoDB Shell (mongosh.exe) is installed at *C:\Users\<user>\AppData\Local\Programs\mongosh*. Add the resulting path for `mongosh.exe` to the `PATH` environment variable.
40+
* Windows: MongoDB Shell (mongosh.exe) is installed at *C:\\Users\\\<user>\\AppData\\Local\\Programs\\mongosh*. Add the resulting path for `mongosh.exe` to the `PATH` environment variable.
4141
1. Download and Install MongoDB:
4242
* macOS/Linux: Verify the directory that MongoDB was installed at, usually in */usr/local/mongodb*. Add the resulting path for `mongodb` to the `PATH` environment variable.
43-
* Windows: MongoDB is installed at *C:\\Program Files\MongoDB* by default. Add *C:\\Program Files\\MongoDB\\Server\\\<version_number>\\bin* to the `PATH` environment variable.
43+
* Windows: MongoDB is installed at *C:\\Program Files\\MongoDB* by default. Add *C:\\Program Files\\MongoDB\\Server\\\<version_number>\\bin* to the `PATH` environment variable.
4444
1. Choose a Data Storage Directory: Select a directory on your development machine for storing data. Create the directory if it doesn't exist. The MongoDB Shell doesn't create new directories:
4545
* macOS/Linux: For example, `/usr/local/var/mongodb`.
4646
* Windows: For example, `C:\\BooksData`.
@@ -52,15 +52,13 @@ Enable MongoDB and MongoDB Shell access from anywhere on the development machine
5252

5353
Use the previously installed MongoDB Shell in the following steps to create a database, make collections, and store documents. For more information on MongoDB Shell commands, see [`mongosh`](https://docs.mongodb.com/mongodb-shell/run-commands/).
5454

55-
1. Open a MongoDB command shell instance by launching `mongosh.exe`.
56-
1. In the command shell, connect to the default test database by running the following command:
55+
1. Open a MongoDB command shell instance by launching `mongosh.exe`, or by running the following command in the command shell:
5756

5857
```console
5958
mongosh
6059
```
6160

62-
1. Run the following command in the command shell:
63-
61+
1. In the command shell connect to the default test database by running:
6462
```console
6563
use BookStore
6664
```
@@ -262,7 +260,7 @@ The preceding web API controller:
262260

263261
1. Build and run the app.
264262

265-
1. Navigate to `https://localhost:<port>/api/books`, where `<port>` is the automatically assigned port number for the app, to test the controller's parameterless `Get` action method, select **Try it out** > **Execute**. A JSON response similar to the following is displayed:
263+
1. Navigate to `https://localhost:<port>/api/books`, where `<port>` is the automatically assigned port number for the app, to test the controller's parameterless `Get` action method. A JSON response similar to the following is displayed:
266264

267265
```json
268266
[
@@ -328,7 +326,7 @@ To satisfy the preceding requirements, make the following changes:
328326

329327
## Additional resources
330328

331-
* [View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mongo-app/samples) ([how to download](xref:index#how-to-download-a-sample))
329+
* [View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mongo-app/samples/8.x/BookStoreApi) ([how to download](xref:index#how-to-download-a-sample))
332330
* <xref:web-api/index>
333331
* <xref:web-api/action-return-types>
334332
* [Create a web API with ASP.NET Core](/training/modules/build-web-api-aspnet-core/)

0 commit comments

Comments
 (0)