Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 2ffc70e

Browse files
Application crashes when using arrayUnion from firestore #985
1 parent 22a543d commit 2ffc70e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

demo-ng/app/tabs/firestore/firestore.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,14 @@ export class FirestoreComponent {
230230
}
231231

232232
arrayUnion(): void {
233-
firebase.firestore().collection("dogs").doc("fave")
233+
firestore.collection("dogs").doc("fave")
234234
.update({
235235
last: "Updated From 'arrayUnion'",
236236
fieldToDelete: firestore.FieldValue.delete(),
237237
updateTs: firebase.firestore().FieldValue().serverTimestamp(),
238-
colors: firebase.firestore().FieldValue().arrayUnion(["red", "blue"])
238+
// just fyi - both these work:
239+
colors: firestore.FieldValue.arrayUnion(["red", "blue"])
240+
// colors: firebase.firestore().FieldValue().arrayUnion(["red", "blue"])
239241
})
240242
.then(() => console.log("Woofie updated from 'arrayUnion'"))
241243
.catch(err => console.log("Updating Woofie from 'arrayUnion' failed, error: " + JSON.stringify(err)));

0 commit comments

Comments
 (0)