小编inv*_*vrt的帖子

onCall 云函数返回“数据无法以 JSON 形式编码。南'

我有一个看起来像这样的 onCall 函数..

exports.getResults = functions.https.onCall((data, context) => {
  const admin = context.auth.token.admin
  const uniqueId = context.auth.uid
  const doc = db.collection('collection').doc(data.docId)

    return doc
      .get()
      .then(querySnapshot => {
        return querySnapshot.docs.map(doc => {
          const doc = doc.data()
          const collectionDoc = {
            docValues
          }
    
          return collectionDoc
        })
      })
      
Run Code Online (Sandbox Code Playgroud)

我的 console.log 将我请求的文档打印为对象,所以我不确定问题是什么?

javascript node.js firebase google-cloud-functions google-cloud-firestore

4
推荐指数
1
解决办法
4001
查看次数