我正在尝试获取用户的uid,该uid在已更改的文档的路径中,但不确定如何从该路径中提取它?
exports.watchTodos = functions.firestore.document('users/{uid}/todos/{docId}')
.onUpdate(async (snap, context) => {
// get the uid of the user
const uid = await context.auth?.uid
console.log(uid)
}