db.collection("rooms").doc(channelId).collection("messages").add({
message: input,
timestamp: serverTimestamp(),
user: 'Apollos',
userImage: 'https://naniwallpaper.com/files/wallpapers/eren-yeager/1-EREN%20YEAGER-1080x1920.jpg'
});
How should this be in firestore v9?
import { doc } from "firebase/firestore";
const messageRef = doc(db, "rooms", chanelID, "messages");
const update = {
message: input,
timestamp: serverTimestamp(),
user: 'Apollos',
userImage: 'https://naniwallpaper.com/files/wallpapers/eren-yeager/1-EREN%20YEAGER-1080x1920.jpg'
}
setDoc(messageRef, update, { merge: true });
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.