我无法找到从触发云功能的用户那里获得电子邮件的方法。
exports.calculateCartTotal =
functions.firestore.document('users/{userEmail}/userCart/{item}').onCreate((snap, context) => {
//I want to access the email of the user that has triggered the function here
});
我有一个云函数,它检查计数值,它是文档中的一个字段,它位于一个“男孩”集合中。在计数变化时,云函数执行一些操作。我想有一个类似的云功能,但另一个集合的名字“女孩”。我如何将另一个功能部署到云功能中,就像现在一样,它只是允许我通过替换旧功能来上传一个功能?
exports.updatingCount = functions.firestore
.document('boys/{count}')
.onWrite((snap) => {//The current function with my code here})
我想要一个类似的函数,但是找不到如何得到它。
我正在尝试部署一个云函数,每当在我的Firestore中创建一个新文档时,它就会更新Algolia搜索索引。一切看起来都很好,但在最后,它出错了。我已经看过这些文档,感觉语法是正确的,所以我不知道现在该做什么。云函数日志没有指向任何东西,只是重复了我在下面收到的错误
错误消息:
=== Deploying to 'test-ffdbb'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
i runtimeconfig: ensuring necessary APIs
我正在创建我的第一个云函数,它简单地将子集合journal中的文档复制到子集合activites中。我希望复制的文档具有相同的postId。函数日志显示
Error: Value for argument "documentPath" is not a valid resource path. Path must be a non-empty string.
at Object.validateResourcePath (/workspace/node_modules/@google-cloud/firestore/build/src/path.js:406:15)
at Co
对于修复云函数TypeScript单元测试,我想模拟doc().id,而不是doc('path')。我该怎么做?
admin.firestore().collection('posts').doc().id // I only want to mock this one
admin.firestore().collection('posts').doc('1')
我试过在西农做下面的事。但是它被困在sinon/proxy-invoke.js:50:47的无限循环中
const collection = admin.firesto
我试着为亚马逊,ebay,ionic/angular和firestore (云功能是可能的)这样的在线商店建立一个网络爬行器。我想得到一些数据的产品,如:名称,描述,形象,也许价格。它应该将数据作为json返回,而不是作为实时预览。
CORS anywhere看起来不错,但我不知道如何将其实现到firestore云函数中。
有没有办法将开放图形协议实现到Firestore云函数或Angular/Ionic应用程序中?
我正在尝试部署一个firebase云函数。它在本地firebase模拟器上工作,但当我尝试部署时,它在firebase控制台云函数日志中显示以下错误:{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":13,"message":"Failed to configure trigger for event-type:providers/cloud.firestore/eventTypes/document.u
我正在尝试将一段数据发布到我的Cloud Firestore中的某个位置。云函数本身是通过HTTPS切换的。对于request.body,我使用bodyParser.json方法。
notifull.post('/postNote', (request, response) => {
// grab variables and files from body and query strings
var subject = request.body.subject;
var category = request.body.category;