Jonathan
Jonathan

Reputation: 9151

How to run Algolia Firestore extension import script?

I'm installing the Algolia extension for Firestore. Setup works just fine and it updates indices on add delete and update. But now I want to backfill it with existing data.

The following steps are provided in the setup guide but I have no clue on HOW to run that script. I've tried pasting it directly in node shell and powershell, adding it to a js or ps1 file and running that but I don't know what kind of script this is.

Firestore console

How do I run this script? (I have a service account json next to it)

Upvotes: 9

Views: 1086

Answers (1)

Jonathan
Jonathan

Reputation: 9151

It's bash...

It works when pasted directly in bash with spaces on each newline after the line terminator. Or as a .sh file from the commandline.

#!/bin/bash
LOCATION=europe-west3\
  ALGOLIA_APP_ID=xxx\
  ALGOLIA_API_KEY=xxx\
  ALGOLIA_INDEX_NAME=organizations\
  COLLECTION_PATH=organizations\
  FIELDS=name,address,city\
  GOOGLE_APPLICATION_CREDENTIALS=./xxx.json\
  npx firestore-algolia-search

Upvotes: 6

Related Questions