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 review wrapper functions

Add review wrapper functions - Google Cloud Tutorial

From the course: Firebase Essential Training

Start my 1-month free trial

Add review wrapper functions

- So we've got our user info wrapper functions completed. Next, we're going to move on to reviews. So we'll close these and then inside the reviews directory, we're going to create a new file for getting reviews from our fire store, we'll call that one get reviews dot JS. And then we're going to add the following code to that. We're going to say import firebase from firebase slash app. And then we're going to say export const get reviews. And this function will be an async function, that'll take a restaurant ID, the ID of the restaurant that we want to get the reviews for. And this one's going to work a little differently than what we saw with the get user info, since we'll be using the dot where method as we saw earlier in the course. So we're going to start off by saying const query snapshot equals await firebase dot firestore parentheses, and we're going to be querying our reviews collection. And we're going to say where…

Contents