React Native Firestore函数错误:RangeError:超出最大调用堆栈大小

时间:2018-11-07 05:05:08

标签: firebase google-cloud-firestore google-cloud-functions

我有一个firestore函数,每当我调用它时,它就会给我标题中提到的错误。我该如何解决?

exports.retrieveCurrentUser = functions.https.onCall((data, context) => {
  let usersRef = admin.firestore().collection('tblusers')
  let user = data.user

  return usersRef.doc(user.uid).once('value').then((userData) => {
    let userFetchedData = userData.data()

    // user found
    if (typeof userFetchedData !== 'undefined') {
      return { userFirestoreData: userFetchedData }
    } else {
      return { userFirestoreData: false }
    }
  }, error => {
    console.log(error)
    return { userFirestoreData: false }
  })
})

0 个答案:

没有答案