Firestore: import sql database - google-cloud-firestore

Can't find any option to import my SQL Database into Firestore database.
Realtime Database has this function, for example.
Is it suggested to be available in Firestore after the Beta ?

I don't think there is a direct import right now.
You have a few options though:
Use the Firebase libraries to export data from your SQL application into Firestore manually (alternatively write a cloud function and get the data via an API). This can also be a good option, if you need to keep both DBs in sync for some transition time.
If you need to get your user accounts over to Firebase Auth, read this article
If you already have your data in a Firestore, gcloud now has an import in beta (https://firebase.google.com/docs/firestore/manage-data/export-import)
From your description I fear that the first option is the way to go for you. Unfortunately Firestore is still in beta and we have to create a lot of functionality ourselves (like SQL imports, data migrations, test mocks, …).

Related

Is there a connectivity possible between google firebase and AWS MongoDB

I have data getting stored in Google firebase (i.e. output of google vision API). I need the same data to get stored in MongoDB which is running on AWS. Is there a connectivity possible between Google cloud and AWS for data migration?
There is no out of the box solution for what you're trying to accomplish. Currently Firestore supports exporting it's data as documented here though the format of the export is probably not something MongoDB could import right away. Even if the format was compatible you would need some kind of data processing pipeline to handle the flow from side to side.
Depending on how you're handling the ingestion of Vision API results you might be able to include code to also send that data to MongoDB. If that's not the case you might need to design a custom solution for this particular use case.

Create a database entry for the UID after sign up with firebase and swift

I’m developing an app in swift by using firebase in the back end.
I have successfully created a user by using the standard procedure as stated in the documentation.
My problem comes when I want to add the UID value to the database. I can’t. What I’m doing is getting the UID (userID) from the Auth().user (what I successfully do) and using the following code (I don’t have de computer do it can contain errors but I copy it from the documentation and I’m fact it compiles, the problem is that is does nothing
let ref = Database().database().reference()
self.ref.child(“users”).setValue(userID)
I have tried with the following
Self.ref.child(“users”).child(user.id).setValue(userID)
But it fails due to the fact that users have no children. The issue is that users is a collection and I don’t now if it works in the same way or not.
My intentions is to create the entry in the “users” collection in the database just after singing up a new user. (And to be able to layer erase it)
Thanks!
Firebase has two NoSQL databases:
the Realtime Database, which is the original JSON database.
Cloud Firestore, which is the newer document/collection database.
These two databases are both part of Firebase, but have completely separate APIs.
You speak about collections in your question, which are a Cloud Firestore concept. But your code uses the API of the Realtime Database. If you're looking to write data to Cloud Firestore, you'll want to use the API that is documented here.

preload Cloud Firestore via json?

I see no way in the Cloud Firestore database interface in my dashboard to (say) import a bunch of "documents" into a collection via JSON (or similar). Am I missing something? I have no problem creating some sideband code in Go to preload/refresh the database. Is this the intended method?
Historically I've done this with SQL files - this is my first foray into NoSQL...
There is no option in the Firebase console to import a JSON into Firestore.
But you can use the gcloud command line tool to both export and import data with Firestore. For a step-by-step walkthrough, see the documentation on exporting and importing data.
A quick search also gave me this firestore-backup-restore npm module. While I'm not sure how up to date it is, its code might be a good starting point in case you need something more custom than what the gcloud CLI gives you.
Alternatively you can of course read the JSON yourself, and call the Firestore API to write the documents. That's pretty much what both tools above do under the hood.

Import Firebase analytics data to MongoDB

I will try to explain the context of the project on which I'm working and the problem which I currently try to overcome. I would like to collect mobile data for analytics purpose, e.g. using Firebase from Google. After collecting thoses data, I'd like to store them in a local database, such as PostgreSQL or MongoDB. But the thing is mobile data collecting platform such as Firebase mostly doesn't support connecting to a local database. I've found out that there is a possibility to export raw data from Firebase to import into a local database, but I have no detail information about this. I've searched through many documentations and I couldn't find anything.Has everyone ever had this kind of problem and can give a clear guidance about exporting data from Firebase and import into a local database? Thanks in advance.
Google Analytics for Firebase collects enormous amount of data and send it to the servers in form of batches or bundles. Three things here with your design:
SDK collects that data and does not expose it for you to parse in the app and store it in local DB.
Storing this much data locally, you are going to re-invent the wheel. In addition, this could cause performance issues.
If you need all the data collected by Firebase in raw form, just link Firebase to Big Query and all data would be available to you.

is there a in built feature in firebase to compose forms to make entries to the database

I have a firebase database where I am storing records. Is there anything already existing features in firebase by which I can use/compose a form to make entries to the database?
The Firebase console has a panel where you can see and manipulate the data in your Firebase Database. But beyond that, there is no functionality in the SDKs to help you build edit forms.