Skip to content

Instantly share code, notes, and snippets.

@Chukslord1
Last active May 2, 2021 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chukslord1/58430aaf25f1ce32b1d872d2b5e2547b to your computer and use it in GitHub Desktop.
Save Chukslord1/58430aaf25f1ce32b1d872d2b5e2547b to your computer and use it in GitHub Desktop.
Instructions for creating indexes

To create indexes, go to the DB Overview tab on the left side of your screen, then click on the New Index button.

We will create three indexes for the database, users_index, appointment_index, and appointment_today_index. The users_index index will enable you to scroll through data in the Users collection using the id field as a parameter to match. The appointment_index index will enable you to scroll through data in the Appointments collection using the user_id field as a parameter to match. The appointment_today_index index will allow you to scroll through data in the Appointments collection. It will use the user_id and date_due fields as parameters to match.

After clicking on the New Index button, you need to select the collection you want to connect to this index. Choose the collection, enter a name for your index, terms for your index, and values. Ticking the Unique checkbox ensures the data entered for the term is unique. The terms field specifies what data you want the index to browse.

For the users_index, we will use the id field as the terms. Also, make sure you tick the unique checkbox so the data entered is unique. For the appointment_index, we will use the user_id field as the terms. For the appointment_today_index we will use the user_id and date_due fields as the terms. After filling in the required fields, click on save and continue.

@cauachagas
Copy link

Thank you for the instructions. One keyword is wrong: apppointment_index --> appointment_index

@Chukslord1
Copy link
Author

Thank you for the instructions. One keyword is wrong: apppointment_index --> appointment_index

Thanks for the correction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment