> For the complete documentation index, see [llms.txt](https://docs.quizhour.mrb-lab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quizhour.mrb-lab.com/admin/3.-firebase-setup/3.3-database-index-setup.md).

# 3.3 Database Index Setup

From the Firestore Database, Click on the **Indexes** tab and click on the **Add Index**. You have to create **three indexes** for the database.

> * Enter **questions** as Collection ID, **quiz\_id** into the first field and set **Ascending**, Enter **created\_at** in the second field and set **Ascending,** Enter **\_\_name\_\_**  in the third field and set **Ascending** and then select **Collection** as query scope and save it.
> * Enter **quizes** as Collection ID, **live\_quiz.is\_live** into the first field and set **Ascending**, Enter **live\_quiz.start\_at** in the second field and set **Ascending,** Enter **\_\_name\_\_**  in the third field and set **Ascending** and then select **Collection** as query scope and save it.
> * Enter **quiz\_comments** as Collection ID, **quiz\_id** into the first field and set **Ascending**, Enter **created\_at** in the second field and set **Descending,** Enter **\_\_name\_\_**  in the third field and set **Descending** and then select **Collection** as query scope and save it.

This may take 3-5 minutes to activate. After completing this, your index page should look like this:

<figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FtNAl7unKZWLp2Y3YQmwC%2FScreenshot%202025-12-30%20at%202.53.57%E2%80%AFPM.png?alt=media&amp;token=7e9625af-8fba-41ba-a8af-482813b93564" alt=""><figcaption></figcaption></figure>
