【发布时间】:2021-12-21 19:20:34
【问题描述】:
我是原生反应新手,我正在尝试删除特定字段但遇到问题
我正在尝试删除 FriendList 中的 cm0IF5KopLgxnJTUtfi403kJuMl2
这是我的代码:
export default function deletefriends(FriendsUID){
const friendremove = async() =>{
// get current users uid
const Uid = firebase.auth().currentUser.uid
// define the current users
const currentUID = firebase.firestore().collection('users').where(
"UID", "==", firebase.auth().currentUser.uid).get();
// add the other users uid to current users friendlist
currentUID.then((querySnapshot) =>
{querySnapshot.forEach((doc) => {doc.ref.update(
{FriendsList:FriendsUID.delete()})
})
})
}
如何删除 FriendsUID?
【问题讨论】:
标签: javascript firebase react-native google-cloud-firestore