Slide 19
Slide 19 text
Write
functions.database.ref(‘path/to/user/{userID}').onCreate(async event => {
let userID = event.params!.userID
let firUser = await
admin.database()
.ref(`path/to/user/${userID}`)
.once(‘value').then(snap => snap.val())
let userIndex = algolia.initIndex('user')
let user = new User(userID, firUser)
return userIndex.addObject(user) // send FCM for callback
})
ref: https://qiita.com/star__hoshi/items/6ee9d1413a34ca5849eb