Setup - Firestore Composite Indexes (All Platforms)

Step 10: Configure Firestore Composite Indexes

To enable efficient querying in Firestore, composite indexes are required for certain collections like emails, homework, and notifications. This ensures that the app can fetch data dynamically based on the logged-in user's role.

Why is This Required?
How to Add Composite Indexes?

Follow these steps to create the required indexes in Firestore:

A. Go to Firestore Indexes

Navigate to Firebase Console > Firestore Database > Indexes.

B. Add Indexes

Click on Add Index and add the following indexes:

C. Verify Index Status

Once added, Firestore will start building the indexes, which might take a few minutes. To check the status:

D. Restart Your App

Once the indexes are ready, restart your app to ensure that queries work correctly.

E. Screenshot of Created Indexes
Firestore Indexes Screenshot