Firestore Database

5. Firestore Database Indexing

To perform Firebase indexing, follow these straightforward steps:

5.1 : To set up NPM on your computer, download Node.js from the following link:https://nodejs.org/en/download/

5.2 : Unzip the source code file named “Firebase Indexing.zip” here.

5.3 : Navigate to the extracted directory of “Firebase Indexing” zip file. Press and hold the ctrl+shift buttons, then right-click the mouse button. From the context menu, select “Open PowerShell window here” to launch Windows PowerShell and execute import/export commands.

5.4 : Execute the command firebase login to log in to Firebase, if you haven’t already done so.

5.5 : Execute the command firebase init

5.6 : Proceed with Y and press the enter button.

5.7 : Choose the Option > Firestore: Configure security rules and index files for Firestore.

Important Notes:

Please Note: Choose the arrow down key to navigate and select options, and press the space button to confirm your selection.

5.8 : Choose the Option > Use an existing project

5.9 : Choose your project

5.10 : Press Enter > ? What file should be used for Firestore Rules? firestore.rules

5.11 : Press Enter > ? What file should be used for Firestore indexes? (firestore.indexes.json)

5.12 : Now, the firestore.indexes.json file will be downloaded. Open this file and copy all the code from firestore_indexes.json file, then paste it into
firestore.indexes.json file.

5.13 : Now execute the command firebase deploy --only firestore:indexes to import indexing in firestore.

See Video: How to Import Firestore Database Indexing in Firebase?