From the course: Firebase Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add restaurant wrapper functions - Google Cloud Tutorial
From the course: Firebase Essential Training
Add restaurant wrapper functions
- [Instructor] Okay, so that's our getReview function. Let's do restaurants now. This is going to be fairly straightforward. We're going to go into our restaurants directory and create a new file called getRestaurants.js and we're going to say import firebase from firebase/app and we'll say export const getRestaurant equals async and then the ID of the restaurant that we want to query and our query is going to look like this. It's going to be pretty similar to what we did with our user info. We're going to say const restaurantDoc equals await firebase.firestore.collection restaurants. We're going to get the restaurant using the ID that was passed into this function and we're going to execute our query by saying .get and then we'll get the data of our restaurant by saying const restaurant equals restaurantDoc.data and then we'll say return dot, dot, dot restaurant and we'll insert the ID into the data that we return as well…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
What is Firestore?3m 47s
-
(Locked)
Firestore query basics7m 18s
-
(Locked)
Set up a Firestore database3m 52s
-
(Locked)
Firestore security rules8m 18s
-
(Locked)
Populate Firestore with development data8m 57s
-
(Locked)
Add user wrapper functions5m 59s
-
(Locked)
Add review wrapper functions4m 30s
-
(Locked)
Add restaurant wrapper functions1m 20s
-
(Locked)
Add reservation wrapper functions6m 46s
-
(Locked)
Add Firestore to a project7m 5s
-
(Locked)
Implement edit profile functionality6m 30s
-
(Locked)
Load available times8m 41s
-
(Locked)
Firestore pricing4m 49s
-
-
-
-
-
-
-