-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOCSP-37618: Usage Examples landing page #2767
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
Merged
norareidy
merged 28 commits into
mongodb:4.1
from
norareidy:DOCSP-37618-usage-ex-landing
Apr 3, 2024
Merged
Changes from 11 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
44a0f86
DOCSP-37618: Usage Examples landing page
norareidy afc83e1
fix refs
norareidy f97fbb3
update TOC
norareidy 79a19c0
format fix
norareidy 6edfb45
CC feedback
norareidy 2885cc5
remove info
norareidy 301ff74
add back
norareidy f08b2be
typo
norareidy e3af41b
CC feedback 2
norareidy 6b0e08f
Merge remote-tracking branch 'upstream/4.1' into DOCSP-37618-usage-ex…
norareidy fc7970d
add section toc
norareidy 9034064
feedback, removing tabs
norareidy ab90497
workflow file
norareidy 9e0b2dc
edits
norareidy 7544220
fix
norareidy fdca1ba
more CC feedback
norareidy 7aa61f9
run -> use
norareidy 8c3905c
changes to running instructions
norareidy 245412f
turn back into steps
norareidy e92f51b
small fixes
norareidy 2fe5eb9
more reworking
norareidy 9faa171
reword
norareidy d2d9c9c
reworking
norareidy 7ad6bdc
feedback
norareidy 27dd0dd
newline
norareidy 9912b50
remove file
norareidy 64afec5
edits
norareidy fc06d29
fix
norareidy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.. _laravel-usage-examples: | ||
|
||
============== | ||
Usage Examples | ||
============== | ||
|
||
.. facet:: | ||
:name: genre | ||
:values: tutorial | ||
|
||
.. meta:: | ||
:keywords: set up, runnable, code example | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 1 | ||
:class: singlecol | ||
|
||
Overview | ||
-------- | ||
|
||
Usage examples show runnable code examples to demonstrate frequently used MongoDB | ||
operations. Each usage example includes the following components: | ||
|
||
- Explanation of the MongoDB operation | ||
- Example controller code that runs the MongoDB operation | ||
- Example view code that renders the result | ||
- Output displayed by the view | ||
|
||
How to Run the Usage Examples | ||
----------------------------- | ||
|
||
To learn how to set up your application and run the usage examples, see the following | ||
sections: | ||
|
||
- :ref:`before-start` | ||
- :ref:`run-usage-examples` | ||
|
||
.. _before-start: | ||
|
||
Before You Get Started | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The usage examples are designed to run operations on a MongoDB deployment that contains | ||
the MongoDB Atlas sample datasets. When you run the example code without this sample data, | ||
the output might not match. | ||
|
||
You can run the usage examples from the Laravel web application and MongoDB Atlas cluster that | ||
you set up in the :ref:`laravel-quick-start` guide. After completing the Quick Start, ensure | ||
that your application meets the following requirements: | ||
|
||
- Configuration to use an Atlas cluster that contains the sample datasets | ||
- ``Movie`` model configured to use the MongoDB database | ||
- ``Movie`` view that lists the results | ||
- HTTP and API controller endpoints for displaying and storing ``Movie`` data | ||
|
||
.. _run-usage-examples: | ||
|
||
Run the Examples | ||
~~~~~~~~~~~~~~~~ | ||
|
||
Each Usage Example page features example code in the :guilabel:`Controller File Code` and | ||
:guilabel:`View File Code` tabs that you can copy and paste into your Laravel application. | ||
|
||
Unless otherwise specified, you can add Usage Example sample code to your application by performing | ||
the following actions: | ||
|
||
- Add the code from the :guilabel:`Controller File Code` tab to your ``MovieController.php`` file in the | ||
``app/Http/Controllers`` directory | ||
- Add the code from the :guilabel:`View File Code` to your ``browse_movies.blade.php`` file in the | ||
``resources/views`` directory. | ||
|
||
Follow the instructions on the Usage Example page to run the code and view the expected output. | ||
GromNaN marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
How a beginner can check all this requirements?
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.
I added a tip directive that links to each corresponding Quick Start step, so the user can click on those for more details on how to fulfill the requirements.