[MUSIC PLAYING]
FRANK VAN PUFFELEN: Ouch.
Hey, everyone.
Welcome to another episode of #AskFirebase.
I'm your host for today, David East,
and I'm going to be covering--
CREW: You're not David East.
FRANK VAN PUFFELEN: What do you mean?
I'm playing David East, am I not?
CREW: No.
FRANK VAN PUFFELEN: I'm confused.
I thought the whole premise is that we have people playing
a character David East, right?
We had Laurence.
I think Laurence was David East.
And before that we had Todd.
We had Mike.
Mike was a good David East.
I think he was the third David East.
And before that we had the little guy,
the one with the skateboard.
Who was that?
CREW: That was the actual David East.
FRANK VAN PUFFELEN: Are you sure?
CREW: Yeah.
FRANK VAN PUFFELEN: So I'm going to be me
today answering Firebase questions?
CREW: That's right.
FRANK VAN PUFFELEN: Oh.
Hey everyone.
Welcome to another episode of the #AskFirebase show.
My name is Frank, or for those of you
who follow me on Twitter, Puf.
And I'm going to be your host for today.
The first question is from Twitter,
and it's from user tutor4dev.
How do I create a user with an email and a password
through the Firebase CLI, the command line tools?
That's a great question.
We actually just added a new command
to the Firebase tools that allows
you to import a whole set of users with a single command.
You now have auth:import, and you can import a CSV file
containing all user information in one go.
Let's have a look at the link below,
and you can see that we have a lot of information,
like a lot of fields that you can have in your CSV file
where you can specify the user information,
like the email address, their full name,
and of course their salted and bcrypted passwords.
So if you have all of these users already from another
system, you have them exported somewhere,
you just take the CSV file and you upload it into Firebase
authentication with the Firebase CLI auth:import commands.
Great question.
Now that I know that I actually get to be myself,
this next question comes from StackOverflow.
I read all the Firebase questions there.
And this one is from BusraNur.
I hope I pronounced that correctly.
How do I retrieve data from Firebase
without having to use a data snapshot?
That's a great question.
Unfortunately on Android, the easiest way
that you can retrieve data from Firebase
is really by using the data snapshot.
We have an SDK, and with that SDK,
you attach to the database, and you
get a data snapshot of all the data
that you requested, and of all changes to that data.
So this is really by far the easiest way.
But if you really don't want to use a data snapshot,
you can use Firebase REST API.
Now I understand that when you just get started with Firebase,
it might be a bit tricky to start using the SDK.
And that's why we have some great material out there,
including the Firebase documentation, but also
our brand new course on Udacity called "Firebase in a Weekend."
Follow the link.
Ooh, next question.
And it's from, let's see, from RanchoSoftware.
How do you model many-to-many relationships
in the Firebase database?
And that's a great and very common question.
It's so common that I actually already
answered it on Stack Overflow.
So let's have a look what I said there.
If you do a relational database and you have
a many-to-many relationship, then you're typically
going to have-- let's say if we have two entities, contractors
and companies, like you have, Rancho, then
you're going to have three tables, right?
You have a table of contractors.
You have a table of companies.
And then you have your many-to-many table
that connects the two together.
In the Firebase database, it's somewhat similar,
but it's also different.
We're still going to have a list of contractors,
and we're going to have a list of companies.
So those are the same.
But now instead of having a single many-to-many table,
we actually have a list of company contractors.
So that's for every company, the contractors for that company,
and a list of contractor companies.
So this is the other way around.
We reversed the logic.
So this is for every contractor, we
have a list of our companies.
You store the information twice, but it allows you to look it up
very efficiently.
Because now once you know the contractor,
you can find the contractor's information in the contractors
list.
And then you can find the contractor's companies
by going to contractor companies,
and then the contractor ID under that,
and then you just have a list of their company IDs.
It's similar to how you do this on a relational database,
but it's also slightly different.
This will take time to get used to,
so don't worry about it too much.
It's very normal that you have to get used to this.
That's why we have some great extra resources for all of you
who come from SQL to actually learn about Firebase.
We have a video series recorded by David East that is called
"Firebase for SQL Developer."
We have to link below here, and I highly
recommend that you check it out.
Because David, in addition to explaining
the details of many-to-many relationships,
he covers many more details, like how
you do advanced querying, how you actually
can do searches on Firebase, and many of the other things
that you are going to encounter as you transition from a SQL
world to Firebase's NoSQL world.
Great question Rancho.
This is the official clap thingy.
CREW: Take 15.
FRANK VAN PUFFELEN: That thing is so Hollywood.
I'm going to be channeling my inner Demi Lovato here.
The next question is from Frank's mom.
That sounds cool.
The question is, I hardly ever see you anymore Frank.
How can I see more of you?
That's a great question mom, and actually I
have the perfect answer for you, because we just
released a new Firebase course on Udacity
called "Firebase in a Weekend."
And good thing mom is that you actually learn not just
about Firebase, but you also get to see more of me
if you take this course.
In that course, you learn everything
about Firebase in just a weekend.
So you learn about the Firebase Realtime
Database, Firebase Notifications, Firebase
Authentication.
You will learn about remote config.
And you can learn it for either Android or iOS.
So whichever platform you prefer,
we have the course for you.
Great question mom.
I really liked that one.
And with that last question, we reach the end of this episode.
And you know what, it wasn't even as
bad as I thought it would be.
Maybe I even like this.
Who knows, I might do more.
If you like this episode, be sure to hit the Like button
below and subscribe.
If you want to learn more about Firebase,
check out Udacity course, "Firebase on the Weekends."
It's actually the most all-encompassing way
that you can learn about Firebase for iOS or Android.
Then also be sure to check out the other episodes
of the #AskFirebase if you have any questions.
Be sure to ask them on your social media of your choosing
with the hashtag #AskFirebase, because that's how we find you.
That's all we have time for today.
Thanks for joining.
I'll see you next time.
[MUSIC PLAYING]
Can you do-- can you do this with a Russian accent?
Please don't use that.
CREW: #AskFirebase.
[LAUGHING]
[SLATE]