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.

The Get Recommendations function

The Get Recommendations function - Google Cloud Tutorial

From the course: Firebase Essential Training

Start my 1-month free trial

The Get Recommendations function

- [Instructor] The next thing we're going to do now is add a getRecommendations function that our front end can use to load a few restaurants to display before the user actually enters a search into the search box. And for now, this will be pretty simple. All we're going to do is just return the three restaurants that are in our firestore, but down the road, the idea is that we'd be able to incorporate a little bit of machine learning here to recommend restaurants to users based on their location, their reservation history, their ratings and so on. So, let's create this function. We'll start off by going into our functions directory and source. And we're going to create a new directory here called restaurants. And then inside there, we're going to create a file called getRecommendations.js. And here's what our files going to look like. As usual, we're going to start off by importing. Import star as functions from firebase…

Contents