Firestore has no concept of update queries, where you send a command to the server and it then applies it to all documents or all documents matching a condition.
Instead, you'll need to read the documents and then update them one at a time, or in batches. The simplest approach is:
db.collection("user").get().then((querySnapshot) => {
querySnapshot.forEach((doc) => {
doc.ref.update({
timestamp: firebase.firestore.FieldValue.serverTimestamp()
})
})
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…