【发布时间】:2021-12-06 05:18:43
【问题描述】:
如何访问和更新 Angular Firebase 中的特定字段,但我的数据在有效负载中我已将图像链接放在对你来说很容易:
[输入此链接并查看图片我在说什么] 1
UserVerification(id, _value: number) {
console.log(id,"KKKKK",_value)
//return this.firestore.collection("DevicesData").doc(id).update({Impact:"100 "});
return this.firestore
.collection("DevicesData")
.doc('/' + '00HcetBoNFIOmwEWZ6fo')
// .doc(id)
.update({Impact:"_value"})
.then(() => {
console.log('done');
})
.catch(function(error) {
console.error('Error writing document: ', error);
});
}
如果我使用此代码,则更新有效负载外的数据,但我想更新有效负载内的数据?
变化
Now In this I'll show how can i put the data .first column I write the payload then second column I put string then after last column I put the my data I'll give a data for You soo please put this data in your payload no
{"Topic":"IMPACT","SID":"1","GPSlat":"634312957","GPSlong":"104014716","GPSalt":"49710","GPSspd":"63","GPShead":"29499222","GPSepoch":"1638504105","Impact":"20200"}
2.Second Image you check please
Now In second image I'll show what is the data sequence my data is in one line first and your data is after payload :
Topic:"Impact"
impact:"2000"
etc.
after your sequence of data is in one line (in this second image I clearly what the data sequence soo please check the image clearly) after that you try to put the update query to update the data then I'll show my error in third image
Now you understand what I am saying that ? Or Not
【问题讨论】:
-
@MattU NO 在此答案中,特定数据不在我的有效负载中,但我的数据在有效负载内,请点击我在问题中提出的链接
标签: javascript firebase google-cloud-firestore