-
Notifications
You must be signed in to change notification settings - Fork 25.1k
corrections in First mongo app #35163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,10 +50,10 @@ Enable MongoDB and MongoDB Shell access from anywhere on the development machine | |
|
|
||
| 1. Download and Install MongoDB Shell: | ||
| * macOS/Linux: Choose a directory to extract the MongoDB Shell to. Add the resulting path for `mongosh` to the `PATH` environment variable. | ||
| * 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. | ||
| * 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. | ||
| 1. Download and Install MongoDB: | ||
| * 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. | ||
| * 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. | ||
| * 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. | ||
| 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: | ||
| * macOS/Linux: For example, `/usr/local/var/mongodb`. | ||
| * Windows: For example, `C:\\BooksData`. | ||
|
|
@@ -65,14 +65,13 @@ Enable MongoDB and MongoDB Shell access from anywhere on the development machine | |
|
|
||
| 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/). | ||
|
|
||
| 1. Open a MongoDB command shell instance by launching `mongosh.exe`. | ||
| 1. In the command shell, connect to the default test database by running the following command: | ||
| 1. Open a MongoDB command shell instance by launching `mongosh.exe`, or by running the following command in the command shell: | ||
|
|
||
| ```console | ||
| mongosh | ||
| ``` | ||
|
|
||
| 1. Run the following command in the command shell: | ||
| 1. In the command shell connect to the default test database by running: | ||
|
|
||
| ```console | ||
| use BookStore | ||
|
|
@@ -268,7 +267,7 @@ The preceding web API controller: | |
|
|
||
| 1. Build and run the app. | ||
|
|
||
| 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: | ||
| 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: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wadepickett in #32353 you explicitly added this text. I don't think this will add much to the docs, as the testing the api part only verifies retrieving the data.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went back and forth on this last time we updated since it would add several steps to the tutorial and yet the json returned in the current minimal step is fairly clear and focus of the tutorial is quickly getting ASP.NET Core and MongoDB going. The more I add beyond what is minimally needed for the goal, the more we start to lose people before they get to the last sections beyond testing. For myself, I'm good with longer tutorials. But I follow the data and response too. That said, you could follow the same Endpoints Explorer .http files for VS and swagger UI for VS Code approach from the [Create a controller-based web API tutorial)[https://review.learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-9.0&branch=pr-en-us-35163&tabs=visual-studio]. I think that would be nice. Then I will keep a watch on how folks react and where they drop off the topic. |
||
|
|
||
| ```json | ||
| [ | ||
|
|
@@ -334,7 +333,7 @@ To satisfy the preceding requirements, make the following changes: | |
|
|
||
| ## Additional resources | ||
|
|
||
| * [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)) | ||
| * [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)) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no 9.x version of the docs. If desired I can create them.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. If you want to that's great. This topic is on my list of many that need an update. You could update it afterwards in a new PR or this one. Up to you. |
||
| * <xref:web-api/index> | ||
| * <xref:web-api/action-return-types> | ||
| * [Create a web API with ASP.NET Core](/training/modules/build-web-api-aspnet-core/) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds extra
\to escape the path backslashes.This fixes an invalid path in the docs (there should be a backslash between users and ):