Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions firestore-next/test.firestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1095,48 +1095,48 @@ describe("firestore", () => {
describe('collectionGroup(landmarks)', () => {
it("should setup example data", async () => {
// [START fs_collection_group_query_data_setup]
const { collection, doc, setDoc } = require("firebase/firestore");
const { collection, addDoc } = require("firebase/firestore");

const citiesRef = collection(db, 'cities');

await Promise.all([
setDoc(doc(citiesRef, 'SF', 'landmarks'), {
addDoc(collection(citiesRef, 'SF', 'landmarks'), {
name: 'Golden Gate Bridge',
type: 'bridge'
}),
setDoc(doc(citiesRef, 'SF', 'landmarks'), {
addDoc(collection(citiesRef, 'SF', 'landmarks'), {
name: 'Legion of Honor',
type: 'museum'
}),
setDoc(doc(citiesRef, 'LA', 'landmarks'), {
addDoc(collection(citiesRef, 'LA', 'landmarks'), {
name: 'Griffith Park',
type: 'park'
}),
setDoc(doc(citiesRef, 'LA', 'landmarks'), {
addDoc(collection(citiesRef, 'LA', 'landmarks'), {
name: 'The Getty',
type: 'museum'
}),
setDoc(doc(citiesRef, 'DC', 'landmarks'), {
addDoc(collection(citiesRef, 'DC', 'landmarks'), {
name: 'Lincoln Memorial',
type: 'memorial'
}),
setDoc(doc(citiesRef, 'DC', 'landmarks'), {
addDoc(collection(citiesRef, 'DC', 'landmarks'), {
name: 'National Air and Space Museum',
type: 'museum'
}),
setDoc(doc(citiesRef, 'TOK', 'landmarks'), {
addDoc(collection(citiesRef, 'TOK', 'landmarks'), {
name: 'Ueno Park',
type: 'park'
}),
setDoc(doc(citiesRef, 'TOK', 'landmarks'), {
addDoc(collection(citiesRef, 'TOK', 'landmarks'), {
name: 'National Museum of Nature and Science',
type: 'museum'
}),
setDoc(doc(citiesRef, 'BJ', 'landmarks'), {
addDoc(collection(citiesRef, 'BJ', 'landmarks'), {
name: 'Jingshan Park',
type: 'park'
}),
setDoc(doc(citiesRef, 'BJ', 'landmarks'), {
addDoc(collection(citiesRef, 'BJ', 'landmarks'), {
name: 'Beijing Ancient Observatory',
type: 'museum'
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,48 @@
// 'npm run snippets'.

// [START fs_collection_group_query_data_setup_modular]
import { collection, doc, setDoc } from "firebase/firestore";
import { collection, addDoc } from "firebase/firestore";

const citiesRef = collection(db, 'cities');

await Promise.all([
setDoc(doc(citiesRef, 'SF', 'landmarks'), {
addDoc(collection(citiesRef, 'SF', 'landmarks'), {
name: 'Golden Gate Bridge',
type: 'bridge'
}),
setDoc(doc(citiesRef, 'SF', 'landmarks'), {
addDoc(collection(citiesRef, 'SF', 'landmarks'), {
name: 'Legion of Honor',
type: 'museum'
}),
setDoc(doc(citiesRef, 'LA', 'landmarks'), {
addDoc(collection(citiesRef, 'LA', 'landmarks'), {
name: 'Griffith Park',
type: 'park'
}),
setDoc(doc(citiesRef, 'LA', 'landmarks'), {
addDoc(collection(citiesRef, 'LA', 'landmarks'), {
name: 'The Getty',
type: 'museum'
}),
setDoc(doc(citiesRef, 'DC', 'landmarks'), {
addDoc(collection(citiesRef, 'DC', 'landmarks'), {
name: 'Lincoln Memorial',
type: 'memorial'
}),
setDoc(doc(citiesRef, 'DC', 'landmarks'), {
addDoc(collection(citiesRef, 'DC', 'landmarks'), {
name: 'National Air and Space Museum',
type: 'museum'
}),
setDoc(doc(citiesRef, 'TOK', 'landmarks'), {
addDoc(collection(citiesRef, 'TOK', 'landmarks'), {
name: 'Ueno Park',
type: 'park'
}),
setDoc(doc(citiesRef, 'TOK', 'landmarks'), {
addDoc(collection(citiesRef, 'TOK', 'landmarks'), {
name: 'National Museum of Nature and Science',
type: 'museum'
}),
setDoc(doc(citiesRef, 'BJ', 'landmarks'), {
addDoc(collection(citiesRef, 'BJ', 'landmarks'), {
name: 'Jingshan Park',
type: 'park'
}),
setDoc(doc(citiesRef, 'BJ', 'landmarks'), {
addDoc(collection(citiesRef, 'BJ', 'landmarks'), {
name: 'Beijing Ancient Observatory',
type: 'museum'
})
Expand Down