This repository was archived by the owner on Mar 4, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,7 +217,6 @@ class DocumentSnapshot {
217217 static fromObject ( ref , obj ) {
218218 return new DocumentSnapshot ( ref , DocumentSnapshot . encodeFields ( obj ) ) ;
219219 }
220-
221220 /**
222221 * Creates a DocumentSnapshot from an UpdateMap.
223222 *
@@ -272,7 +271,7 @@ class DocumentSnapshot {
272271 target [ key ] = childNode ;
273272 return target ;
274273 } else {
275- return null ;
274+ return ! is . empty ( target ) ? target : null ;
276275 }
277276 }
278277 } else {
Original file line number Diff line number Diff line change @@ -1455,31 +1455,47 @@ describe('update document', function() {
14551455 requestEquals (
14561456 request ,
14571457 update (
1458- document ( 'foo ' , {
1458+ document ( 'a ' , {
14591459 mapValue : {
14601460 fields : {
1461- bar : {
1462- stringValue : 'include' ,
1463- valueType : 'stringValue' ,
1461+ b : {
1462+ valueType : 'mapValue' ,
1463+ mapValue : {
1464+ fields : {
1465+ keep : {
1466+ stringValue : 'keep' ,
1467+ valueType : 'stringValue' ,
1468+ } ,
1469+ } ,
1470+ } ,
1471+ } ,
1472+ c : {
1473+ valueType : 'mapValue' ,
1474+ mapValue : {
1475+ fields : {
1476+ keep : {
1477+ stringValue : 'keep' ,
1478+ valueType : 'stringValue' ,
1479+ } ,
1480+ } ,
1481+ } ,
14641482 } ,
14651483 } ,
14661484 } ,
14671485 valueType : 'mapValue' ,
14681486 } ) ,
1469- updateMask ( 'foo.bar ' , 'foo. delete' )
1487+ updateMask ( 'a.b.delete ' , 'a.b.keep' , 'a.c. delete' , 'a.c.keep ')
14701488 )
14711489 ) ;
14721490
14731491 callback ( null , writeResult ( 1 ) ) ;
14741492 } ;
1475- return firestore
1476- . doc ( 'collectionId/documentId' )
1477- . update (
1478- 'foo.bar' ,
1479- 'include' ,
1480- 'foo.delete' ,
1481- Firestore . FieldValue . delete ( )
1482- ) ;
1493+ return firestore . doc ( 'collectionId/documentId' ) . update ( {
1494+ 'a.b.delete' : Firestore . FieldValue . delete ( ) ,
1495+ 'a.b.keep' : 'keep' ,
1496+ 'a.c.delete' : Firestore . FieldValue . delete ( ) ,
1497+ 'a.c.keep' : 'keep' ,
1498+ } ) ;
14831499 } ) ;
14841500
14851501 it ( 'with field with dot ' , function ( ) {
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ describe('Order', function() {
177177 [ resource ( 'projects/p1/databases/d1/documents/c10/doc1' ) ] ,
178178 [ resource ( 'projects/p1/databases/dkkkkklkjnjkkk1/documents/c2/doc1' ) ] ,
179179 [ resource ( 'projects/p2/databases/d2/documents/c1/doc1' ) ] ,
180- [ resource ( 'projects/p2/databases/d2/documents/cl -/doc1' ) ] ,
180+ [ resource ( 'projects/p2/databases/d2/documents/c1 -/doc1' ) ] ,
181181
182182 // geo points
183183 [ geopoint ( - 90 , - 180 ) ] ,
You can’t perform that action at this time.
0 commit comments