-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Description
snippets-web/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js
Lines 8 to 53 in fdc51dd
| import { collection, doc, setDoc } from "firebase/firestore"; | |
| const citiesRef = collection(db, 'cities'); | |
| await Promise.all([ | |
| setDoc(doc(citiesRef, 'SF', 'landmarks'), { | |
| name: 'Golden Gate Bridge', | |
| type: 'bridge' | |
| }), | |
| setDoc(doc(citiesRef, 'SF', 'landmarks'), { | |
| name: 'Legion of Honor', | |
| type: 'museum' | |
| }), | |
| setDoc(doc(citiesRef, 'LA', 'landmarks'), { | |
| name: 'Griffith Park', | |
| type: 'park' | |
| }), | |
| setDoc(doc(citiesRef, 'LA', 'landmarks'), { | |
| name: 'The Getty', | |
| type: 'museum' | |
| }), | |
| setDoc(doc(citiesRef, 'DC', 'landmarks'), { | |
| name: 'Lincoln Memorial', | |
| type: 'memorial' | |
| }), | |
| setDoc(doc(citiesRef, 'DC', 'landmarks'), { | |
| name: 'National Air and Space Museum', | |
| type: 'museum' | |
| }), | |
| setDoc(doc(citiesRef, 'TOK', 'landmarks'), { | |
| name: 'Ueno Park', | |
| type: 'park' | |
| }), | |
| setDoc(doc(citiesRef, 'TOK', 'landmarks'), { | |
| name: 'National Museum of Nature and Science', | |
| type: 'museum' | |
| }), | |
| setDoc(doc(citiesRef, 'BJ', 'landmarks'), { | |
| name: 'Jingshan Park', | |
| type: 'park' | |
| }), | |
| setDoc(doc(citiesRef, 'BJ', 'landmarks'), { | |
| name: 'Beijing Ancient Observatory', | |
| type: 'museum' | |
| }) | |
| ]); |
Invalid document reference. Document references must have an even number of segments, but cities/SF/landmarks has 3.
QualitasGit
Metadata
Metadata
Assignees
Labels
No labels