Skip to content

Commit 3d38a8d

Browse files
committed
fix import script document name format
1 parent f70f546 commit 3d38a8d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

firestore-bigquery-export/scripts/import/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebaseextensions/fs-bq-import-collection",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Import a Firestore Collection into a BigQuery ChangeLog Table",
55
"main": "./lib/index.js",
66
"repository": {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const FIRESTORE_VALID_CHARACTERS = /^[^\/]+$/;
4040
const FIRESTORE_COLLECTION_NAME_MAX_CHARS = 6144;
4141
const BIGQUERY_RESOURCE_NAME_MAX_CHARS = 1024;
4242

43+
const FIRESTORE_DEFAULT_DATABASE = "(default)";
44+
4345
const validateInput = (value: string, name: string, regex: RegExp, sizeLimit: number) => {
4446
if (!value || value === "" || value.trim() === "") {
4547
return `Please supply a ${name}`;
@@ -172,7 +174,7 @@ const run = async (): Promise<number> => {
172174
return {
173175
timestamp: new Date(0).toISOString(), // epoch
174176
operation: ChangeType.IMPORT,
175-
documentName: snapshot.ref.path,
177+
documentName: `projects/${projectId}/databases/${FIRESTORE_DEFAULT_DATABASE}/documents/${snapshot.ref.path}`,
176178
eventId: "",
177179
data: snapshot.data(),
178180
};

0 commit comments

Comments
 (0)