-
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
Changes from 4 commits
44a0f86
afc83e1
f97fbb3
79a19c0
6edfb45
2885cc5
301ff74
f08b2be
e3af41b
6b0e08f
fc7970d
9034064
ab90497
9e0b2dc
7544220
fdca1ba
7aa61f9
8c3905c
245412f
e92f51b
2fe5eb9
9faa171
d2d9c9c
7ad6bdc
27dd0dd
9912b50
64afec5
fc06d29
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
.. _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 | ||
|
||
.. TODO: add usage examples to TOC as they're made | ||
.. toctree:: | ||
|
||
|
||
Overview | ||
-------- | ||
|
||
Usage examples show runnable code examples to demonstrate frequently used MongoDB | ||
operations. Each usage example includes the following: | ||
|
||
- Description of the MongoDB operation | ||
ccho-mongodb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Code example that runs the MongoDB operation, which you can paste into your controller file | ||
- Code example that specifies a view, which you can paste into your view file | ||
ccho-mongodb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Output returned by the view | ||
ccho-mongodb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
How to Use the Usage Examples | ||
ccho-mongodb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
----------------------------- | ||
|
||
The usage examples are designed to run operations on a MongoDB deployment that contains | ||
the Atlas sample datasets. When you run the example code without the sample data, the output | ||
ccho-mongodb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
might not match. | ||
|
||
Follow this tutorial to set up your MongoDB deployment with the sample data and run the | ||
example code in your development environment. Before performing the following actions, | ||
ensure that you create an Atlas account and deploy a cluster. For information about setting | ||
up an account and a cluster, see the :atlas:`Get Started with Atlas Guide | ||
</getting-started/#atlas-getting-started>`. | ||
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. Issue:
Suggestion: I think keeping the description of the steps and the procedure/steps aligned would be helpful. I also think this page should delegate some of the explanation of how to run them to the specific usage example since the procedure might differ depending on the operation. E.g. "You can run the usage examples from Laravel web application and MongoDB Atlas cluster that you set up in the :ref: To run the example controller code and view the results, follow the instructions on the usage example page. Let me know if you need any help with filling out the details. 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 for this detailed comment; I think I made all the changes you requested, let me know if it looks alright |
||
|
||
.. procedure:: | ||
:style: connected | ||
|
||
.. step:: Create a Laravel Application | ||
|
||
Follow the instructions in the :ref:`laravel-quick-start` guide to set up | ||
a Laravel application. | ||
|
||
After completing the Quick Start, ensure that your application meets the following | ||
requirements: | ||
|
||
- Connects to the ``movies`` collection in the Atlas sample datasets | ||
- Contains the ``MovieController.php`` and ``browse_movies.blade.php`` files | ||
|
||
.. step:: Add the Usage Example Code to Your Application | ||
|
||
Copy the example code from the :guilabel:`Controller File Code` tab on the usage example | ||
page and paste it into the ``MovieController.php`` file. | ||
|
||
Then, copy the example code from the :guilabel:`View File Code` tab and paste it into the | ||
``browse_movies.blade.php`` file. | ||
|
||
.. step:: Run the Usage Example Code | ||
|
||
Run the following command to start your Laravel application and run the MongoDB operation: | ||
|
||
.. code-block:: bash | ||
|
||
php artisan serve | ||
|
||
After completing these steps, you can see the output described in the **Expected Output** section | ||
of the corresponding usage example. | ||
|
||
.. TODO: add usage examples to list as they're made | ||
ccho-mongodb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Available Usage Examples | ||
------------------------ | ||
- :ref:`Find a Document <laravel-find-one-usage>` | ||
- :ref:`Find Multiple Documents <laravel-find-usage>` | ||
- :ref:`Insert a Document <laravel-insert-one-usage>` | ||
- :ref:`Insert Multiple Documents <laravel-insert-many-usage>` | ||
- :ref:`Update a Document <laravel-update-one-usage>` | ||
- :ref:`Update Multiple Documents <laravel-update-many-usage>` | ||
- :ref:`Delete a Document <laravel-delete-one-usage>` | ||
- :ref:`Delete Multiple Documents <laravel-delete-many-usage>` | ||
- :ref:`Count Documents <laravel-count-usage>` | ||
- :ref:`Retrieve Distinct Field Values <laravel-distinct-usage>` | ||
ccho-mongodb marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.