add data to cloud firestore
make database
firebaseのHP上でデータベースをつくっておくこと
make document
import { doc, setDoc } from 'firebase/firestore';
const docRef = doc(db, 'cities', 'LA');
const docData = {
name: "LOS ANGELES",
state: "CA",
country: "USA"
};
await setDoc(docRef, docData);
reference
[https://firebase.google.com/docs/firestore/manage-data/add-data?hl=ja]
BACK