以下将解决问题:
import { collection, doc, setDoc } from "firebase/firestore";
// Add a new document with a generated id
const newDocRef = doc(collection(db, "projects"));
// Set the doc, using the id property of the DocumentReference
await setDoc(newDocRef, {
name: project,
uid: currentUser,
projectId: newDocRef.id
}
);
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句