| { |
| "tests": [ |
| { |
| "description": "create: multiple ArrayRemove fields", |
| "comment": "A document can have more than one ArrayRemove field.\nSince all the ArrayRemove fields are removed, the only field in the update is \"a\".", |
| "create": { |
| "docRefPath": "projects/projectID/databases/(default)/documents/C/d", |
| "jsonData": "{\"a\": 1, \"b\": [\"ArrayRemove\", 1, 2, 3], \"c\": {\"d\": [\"ArrayRemove\", 4, 5, 6]}}", |
| "request": { |
| "database": "projects/projectID/databases/(default)", |
| "writes": [ |
| { |
| "update": { |
| "name": "projects/projectID/databases/(default)/documents/C/d", |
| "fields": { |
| "a": { |
| "integerValue": "1" |
| } |
| } |
| }, |
| "currentDocument": { |
| "exists": false |
| } |
| }, |
| { |
| "transform": { |
| "document": "projects/projectID/databases/(default)/documents/C/d", |
| "fieldTransforms": [ |
| { |
| "fieldPath": "b", |
| "removeAllFromArray": { |
| "values": [ |
| { |
| "integerValue": "1" |
| }, |
| { |
| "integerValue": "2" |
| }, |
| { |
| "integerValue": "3" |
| } |
| ] |
| } |
| }, |
| { |
| "fieldPath": "c.d", |
| "removeAllFromArray": { |
| "values": [ |
| { |
| "integerValue": "4" |
| }, |
| { |
| "integerValue": "5" |
| }, |
| { |
| "integerValue": "6" |
| } |
| ] |
| } |
| } |
| ] |
| } |
| } |
| ] |
| } |
| } |
| } |
| ] |
| } |