【发布时间】:2018-09-17 19:39:32
【问题描述】:
我正在使用 firestore,在用户 Employee 集合下,我想使用 id 删除特定员工。我的代码是
export const employeeSave = ({
name,
phone,
shift,
uid
}) => {
const {
currentUser
} = firebase.auth();
return (dispatch) => {
firebase.firestore().collection('users').doc(currentUser.uid).collection('employees').doc(uid).update({
name,
phone,
shift
}).then(() => {
dispatch({
type: EMPLOYEE_SAVE_SUCCESS
});
Actions.employeeList({
type: 'reset'
});
});
};
};
【问题讨论】:
-
请将您的代码包装在代码配额中 `` 或使用此帮助以便能够阅读和理解您的代码:stackoverflow.com/editing-help#comment-formatting
标签: javascript firebase google-cloud-firestore