File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change
1
+ firebase-debug.log
Original file line number Diff line number Diff line change @@ -410,6 +410,22 @@ describe("firestore", () => {
410
410
// [END update_document]
411
411
} ) ;
412
412
413
+ it ( "should update an array field in a document" , ( ) => {
414
+ // [START update_document_array]
415
+ var washingtonRef = db . collection ( "cities" ) . doc ( "DC" ) ;
416
+
417
+ // Atomically add a new region to the "regions" array field.
418
+ washingtonRef . update ( {
419
+ regions : firebase . firestore . FieldValue . arrayUnion ( "greater_virginia" )
420
+ } ) ;
421
+
422
+ // Atomically remove a region from the "regions" array field.
423
+ washingtonRef . update ( {
424
+ regions : firebase . firestore . FieldValue . arrayRemove ( "east_coast" )
425
+ } ) ;
426
+ // [END update_document_array]
427
+ } ) ;
428
+
413
429
it ( "should delete a document" , ( ) => {
414
430
return output =
415
431
// [START delete_document]
You can’t perform that action at this time.
0 commit comments