Firestore Database

7. Firestore Database Indexing

To do firebase indexing please follow these simple steps.

7.1 : Setup NPM in your Computer, you can download node JS from:https://nodejs.org/en/download/

7.2 : Extract source code of Firebase Indexing.zip

7.3 : Go to extracted (Firebase Indexing) zip file path and press & hold ctrl+shift button and right click of mouse button and click on “Open PowerShell window here” menu item in context menu to open Window PowerShell to run import/export command.

7.4 : Run firebase login (If not logged in) to login in the firebase.

7.5 : Run command firebase init

7.6 : Proceed with Y & enter

7.7 : Select Option > Firestore: Configure security rules and indexes files for Firestore.

Important Notes:

Use the arrow down key to select option & press space button to select option.

7.8 : Select option > Use an existing project

7.9 : Select your project

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

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

7.12 : Now the firestore.indexes.json file will be downloaded, open that file and copy all the code from firestore_indexes.json file and paste into firestore.indexes.json file.
7.13: Now Run this command firebase deploy --only firestore:indexes to import indexing in firestore.

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