使用Kimonolabs Webhook发布数据 [英] Posting Data with Kimonolabs Webhook

查看:76
本文介绍了使用Kimonolabs Webhook发布数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我坚持这个问题,如果我想通过Webhook在我的数据库中发布我的和服数据,它会给我这样的JSON:

I stuck at the problem, that if I want to post my Kimono Data via Webhook in my Database it gives me a JSON like this:

{ "name": "",..."results": {"collection1": [{ ...}]} 

问题是这类JSON在我的数据库中创建了一行,并在其中存储了所有数据的一个属性结果.但是实际上,我需要结果集合中不同行中的元素才能使用它们.我试图用Kimonolabs中的给定功能转换数据,但我认为它不会像这样工作.

The problem is that these kind of JSON creates one single row in my database with one attribute results where all my data is stored. But actually I need the elements in the result collection in different rows to be able to work with them. I tryed to transform the data with the given feature in Kimonolabs but i doesn't think it's gonna work like this.

有人知道如何解决此问题吗?

Does anybody have an idea how to fix this issue?

推荐答案

我找到了一些解决方法.当您为和服数据创建一个类,用于在其中存储来自Webhook的帖子时,可以编写afterSave方法的云代码.因此,如果出现在Kimono类中的新行,则会执行afterSafe方法.现在,您可以拆分和修改数据,并将其保存在单独的表中.对我来说很好.

I've found a little workaround. When you create a class for your Kimono data where you store the posts from the webhook, you can write a cloud code afterSave method. So if a new row in the Kimono class appears, the afterSafe method gets executed. Now you can split and modify your data and save it in a separate table. Works fine for me.

这篇关于使用Kimonolabs Webhook发布数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆