Skip to content

Commit ff2bab0

Browse files
authored
Merge pull request #547 from gregfenton/gregfenton-patch-1
Clarifying docs for non-interactive use of `fs-bq-import-collection`
2 parents 327aedd + f984e1f commit ff2bab0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

firestore-bigquery-export/guides/IMPORT_EXISTING_DOCUMENTS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The import script uses several values from your installation of the extension:
2727

2828
- `${PROJECT_ID}`: the project ID for the Firebase project in which you installed the extension
2929
- `${COLLECTION_PATH}`: the collection path that you specified during extension installation
30-
- `${COLLECTION_GROUP_QUERY}`: Confirmation you would like to use a `collectionGroup` query. Reverts to a `collection` query if the value is `false`.
30+
- `${COLLECTION_GROUP_QUERY}`: uses a `collectionGroup` query if this value is `"true"`. For any other value, a `collection` query is used.
3131
- `${DATASET_ID}`: the ID that you specified for your dataset during extension installation
3232

3333
Run the import script using [`npx` (the Node Package Runner)](https://www.npmjs.com/package/npx) via `npm` (the Node Package Manager).
@@ -47,12 +47,14 @@ Run the import script using [`npx` (the Node Package Runner)](https://www.npmjs.
4747

4848
Alternatively, you can [create and use a service account](https://cloud.google.com/docs/authentication/production#obtaining_and_providing_service_account_credentials_manually). This service account must be assigned a role that grants the `bigquery.datasets.create` [permission](https://cloud.google.com/bigquery/docs/access-control#bq-permissions).
4949

50-
1. Run the import script via `npx` by running the following command:
50+
1. Run the import script interactively via `npx` by running the following command:
5151

5252
```
5353
npx @firebaseextensions/fs-bq-import-collection
5454
```
5555

56+
**Note**: The script can be run non-interactively. To see its usage, run the above command with `--help`.
57+
5658
1. When prompted, enter the Cloud Firestore collection path that you specified during extension installation, `${COLLECTION_PATH}`.
5759

5860
1. _(Optional)_ You can pause and resume the import at any time:

firestore-bigquery-export/scripts/import/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ program
113113
"The path of the the Cloud Firestore Collection to import from. (This may, or may not, be the same Collection for which you plan to mirror changes.)"
114114
)
115115
.option(
116-
"-q, --query-collection-group <query-collection-group>",
117-
"A boolean value indicating whether you'd prefer a collection group query (true) or a collection query (false)"
116+
"-q, --query-collection-group [true|false]",
117+
"Use 'true' for a collection group query, otherwise a collection query is performed."
118118
)
119119
.option(
120120
"-d, --dataset <dataset>",

0 commit comments

Comments
 (0)