📜  firebase v9 获取字段值服务器时间 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:11.959000             🧑  作者: Mango

代码示例1
import { updateDoc, serverTimestamp } from "firebase/firestore";

const docRef = doc(db, 'objects', 'some-id');

// Update the timestamp field with the value from the server
const updateTimestamp = await updateDoc(docRef, {
    timestamp: serverTimestamp()
});