我想使用带有CSV数据的邮递员集合进行REST API POST。 但是CSV数据不能固定在键值对上。
样本: CSV数据:
addMessage() {
if(this.message.length < 30 && this.message.length > 10) {
alert('ok')
var new= db.collection("messages").doc(this.alias)
new.set( {
messages: this.message,
date: Date.now()
})
} else {
alert('no')
}
请求应为:
accountNumber,accountProfileId,value1,key1,value2,key2
123,Premium,children,y,married,y
]
但是,如果CSV数据:
"status": "ACTIVE",
accountProfileId: "Premium",
"accountNumber": "123",
"billingAddress": [
{
"key": "Children",
"value": "y"
},
{
"key": "Married",
"value": "Y"
}
请求应为:
accountNumber,accountProfileId,value1,key1,value2,key2
123,Premium,children,y,,
]
我想知道有人可以帮忙吗?
谢谢