Firestore Import – Effortlessly Sync Apify Datasets with Firestore
2 min read
Intro:
The Firestore Import actor from Apify.com enables users to effortlessly import data from an Apify dataset into a Firebase Firestore database. This tool is particularly valuable for developers and data analysts looking to efficiently transfer large amounts of structured data into a NoSQL database.
🔍 What Is Firestore Import?
The Firestore Import API is a powerful integration that facilitates the migration of data into Firebase Firestore, a NoSQL cloud database built on Google's infrastructure. It extracts various datasets and offers options for conflict resolution and data transformation, making it ideal for developers and data engineers needing seamless data integration solutions.
✨ Features
- Customizable Document IDs: Generate document IDs automatically or define them using fields from your dataset.
- Conflict Management: Choose how to handle existing documents with options to overwrite, merge, or skip.
- Data Transformation: Use a customizable JavaScript function to transform dataset items before import.
- Batch Importing: Import multiple items in batches for efficiency.
- Sub-collection Support: Directly import data into specific sub-collections within Firestore.
🛠️ How to Use It
Step-by-step tutorial:
- Go to the tool’s page: Firestore Import
- Click “Try for free” or “Run actor”.
- Fill in the required input fields:
serviceAccountKey
: Service account key in JSON format.datasetId
: ID of the Apify dataset to import data from.collection
: Firestore collection to import data to.
- Click “Run” and wait for results.
- Download the results or send them to a webhook.
🧪 Sample Input (JSON)
json { "serviceAccountKey": "{your_service_account_key}", "datasetId": "your_dataset_id", "collection": "your_collection_name", "documentConflictResolution": "merge", "transformFunction": "function(item) { return { data: item }; }" }
📤 Output Data (Fields)
imported
: Total number of imported documents.skipped
: Number of documents that were skipped.overwritten
: Total documents that were overwritten.merged
: Total documents that were merged.created
: Number of new documents created.failed
: Number of failed write operations.itemsProcessed
: Total dataset items processed.executionTimeMs
: Time taken for the import in milliseconds.
💰 Pricing This actor is priced at $0.65 per 1,000 writes. Apify also offers a free trial for new users.
👨💻 Built By Apify Team — from Apify.com
✅ Final Thoughts The Firestore Import actor is an indispensable tool for developers looking to efficiently manage and import data into Firebase. With its rich features like customizable transformations and conflict resolution strategies, it simplifies what can otherwise be a complex task, making it a must-try for anyone working with Firestore.
🔗 Try the Actor Now 👉 Firestore Import