gpt4 book ai didi

javascript - 我的 firebase 函数的错误没有记录到控制台

转载 作者:行者123 更新时间:2023-11-28 17:30:59 27 4
gpt4 key购买 nike

我的 firebase 云函数拒绝记录我从 firestore 传递给它的数据,并且在使用 try 和 catch 函数后它也拒绝显示错误。

import * as functions from 'firebase-functions';

const admin = require('firebase-admin')
admin.initializeApp(functions.config().firebase)

const ref = admin.firestore();

export const dailyCheck = functions.https.onRequest((request,
response) => {
console.log('load it again')
const currentTime = new Date().getTime()
const twoMonths = currentTime + 2592000000
console.log(twoMonths + ' ----currentTime + 2months');
console.log(currentTime + '---curentTime only');

try {
ref.collection('customers').where('finishDatemind', '<',
`${twoMonths}`)
.get().then(data => {
data.forEach(doc => {

console.log(doc.data()+'here it is');

})
})
}
catch (e) { console.error(e) }

});

它在我的函数日志控制台上返回此内容:

   1526845438060---curentTime only
1529437438060 ----currentTime + 2months
load it again

最佳答案

我刚刚找到了答案。在查询我的 Firebase Firestore 时,我使用了 ${twoMonths} 而不是 twoMonths

关于javascript - 我的 firebase 函数的错误没有记录到控制台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50438983/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com