Skip to content

FirebaseError #249

Closed
Closed
@MGRaghavendra

Description

@MGRaghavendra

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions