|
| 1 | +import Tabs from '@theme/Tabs'; |
| 2 | +import TabItem from '@theme/TabItem'; |
| 3 | + |
1 | 4 | # 👐 Quick Start |
2 | 5 |
|
| 6 | +:::tip |
| 7 | +In this lab, we will be using Jupyter Notebooks, which is an interactive Python environment. If you are new to Jupyter Notebooks, use [this](https://mongodb-developer.github.io/vector-search-lab/docs/dev-env/jupyter-notebooks) guide to familiarize yourself with the environment. |
| 8 | +::: |
| 9 | + |
| 10 | +<Tabs groupId="setup options"> |
| 11 | +<TabItem value="Instruqt" label="Instruqt"> |
| 12 | + |
| 13 | +Instruqt is a lab platform that provides cloud-based sandboxes which come pre-configured with all the tools you need to run this lab. |
| 14 | + |
| 15 | +**Navigate to the Instruqt lab using [this](http://mdb.link/instruqt-jedee) link.** Fill out the form that appears and click **Submit and access**. |
| 16 | + |
| 17 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/3-submit-form.png" alt="Submit Instruqt form" /> |
| 18 | + |
| 19 | +Click **Start** to launch the lab environment. |
| 20 | + |
| 21 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/4-start-sandbox-setup.png" alt="Start Instruqt sandbox" /> |
| 22 | + |
| 23 | +You should see a screen with a purple progress bar indicating that Instruqt is preparing a sandbox with all the required libraries for this lab and a MongoDB cluster. |
| 24 | + |
| 25 | +Once this is done, you should see a Start button at the bottom right of the screen. Click this to enter the lab. |
| 26 | + |
| 27 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/5-start-lab.png" alt="Start Instruqt lab" /> |
| 28 | + |
| 29 | +</TabItem> |
| 30 | + |
| 31 | +<TabItem value="GitHub Codespaces" label="GitHub Codespaces"> |
| 32 | + |
3 | 33 | 1. Sign in to Github, and open this repository: [mdb.link/jedee](https://mdb.link/jedee) |
4 | 34 | 2. Click on `Code` > Click on `Codespaces` > Click on `Create a Codespace on Main` |
5 | 35 | 3. ⚠️ **Wait for the Codespace to load completely** |
6 | | -4. Click on the MongoDB extension |
7 | | -5. Click on the `Library DB` in the connections and then select the `library` database |
8 | | -6. Open a playground into the `books` collection |
9 | | -7. Write MongoDB commands in the playground |
10 | | -8. Run MongoDB commands by clicking on the play icon :arrow_forward: at the top right corner |
11 | | -9. Practice by trying out all the examples and exercises mentioned in the next 2 sections: CRUD ops and Aggregation Pipelines. |
12 | | - |
13 | | - |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +</TabItem> |
| 40 | + |
| 41 | +</Tabs> |
| 42 | + |
| 43 | +### Connect to the MongoDB cluster |
| 44 | + |
| 45 | +Let's first connect to the MongoDB database that was created for you. This will allow you to view data we import into the cluster later in the lab, directly from the IDE. |
| 46 | + |
| 47 | +To do this, click the leaf icon in the left navigation bar of the IDE. This is MongoDB's VSCode extension. |
| 48 | + |
| 49 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/6-click-leaf.png" alt="Click leaf icon" /> |
| 50 | + |
| 51 | +Under **Connections**, click the _Local MongoDB Atlas_ connection. This should automatically establish a connection to the local MongoDB cluster running on port 27017. |
| 52 | + |
| 53 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/7-connect-cluster.png" alt="Connect to the cluster" /> |
| 54 | + |
| 55 | +If the connection was successful, you should see a green leaf and a "connected" message appear around the _Local MongoDB Atlas_ connection. |
| 56 | + |
| 57 | +You will also see the default databases in the cluster appear under **Connections**. Any additional databases we create during the lab will also appear here. |
| 58 | + |
| 59 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/8-connection-successful.png" alt="Connection successful" /> |
| 60 | + |
| 61 | +### Jupyter Notebook setup |
| 62 | + |
| 63 | +You will be filling code in a Jupyter Notebook during this lab, so let's get set up with that next! |
| 64 | + |
| 65 | +Within the sandbox, click on the files icon in the left navigation bar of the IDE. In the Explorer menu, navigate to `jedee` > `javascript` > `01_connect_database.ipynb` to open the Jupyter Notebook for this lab. |
| 66 | + |
| 67 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/2-nav-notebook.png" alt="Navigate to the notebook" /> |
| 68 | + |
| 69 | +Next, select the Python interpreter by clicking **Select Kernel** at the top right of the IDE. |
| 70 | + |
| 71 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/9-select-kernel.png" alt="Select kernel" /> |
| 72 | + |
| 73 | +In the modal that appears, click **Python environments...** and select the interpreter that is marked as **Recommended** or **Global Env**. |
| 74 | + |
| 75 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/10-python-env-modal.png" alt="Select Python Environments" /> |
| 76 | + |
| 77 | +<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/11-select-recommended.png" alt="Select recommended interpreter" /> |
| 78 | + |
| 79 | +That's it! You're ready for the lab! |
0 commit comments