-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bc/bulk-master
- Loading branch information
Showing
230 changed files
with
10,332 additions
and
15 deletions.
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
dev/conformance/conformance-tests/create-all-transforms.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"tests": [ | ||
{ | ||
"description": "create: all transforms in a single call", | ||
"comment": "A document can be created with any amount of transforms.", | ||
"create": { | ||
"docRefPath": "projects/projectID/databases/(default)/documents/C/d", | ||
"jsonData": "{\"a\": 1, \"b\": \"ServerTimestamp\", \"c\": [\"ArrayUnion\", 1, 2, 3], \"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", | ||
"setToServerValue": "REQUEST_TIME" | ||
}, | ||
{ | ||
"fieldPath": "c", | ||
"appendMissingElements": { | ||
"values": [ | ||
{ | ||
"integerValue": "1" | ||
}, | ||
{ | ||
"integerValue": "2" | ||
}, | ||
{ | ||
"integerValue": "3" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"fieldPath": "d", | ||
"removeAllFromArray": { | ||
"values": [ | ||
{ | ||
"integerValue": "4" | ||
}, | ||
{ | ||
"integerValue": "5" | ||
}, | ||
{ | ||
"integerValue": "6" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
69 changes: 69 additions & 0 deletions
69
dev/conformance/conformance-tests/create-arrayremove-multi.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"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" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
53 changes: 53 additions & 0 deletions
53
dev/conformance/conformance-tests/create-arrayremove-nested.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"tests": [ | ||
{ | ||
"description": "create: nested ArrayRemove field", | ||
"comment": "An ArrayRemove value can occur at any depth. In this case,\nthe transform applies to the field path \"b.c\". Since \"c\" is removed from the update,\n\"b\" becomes empty, so it is also removed from the update.", | ||
"create": { | ||
"docRefPath": "projects/projectID/databases/(default)/documents/C/d", | ||
"jsonData": "{\"a\": 1, \"b\": {\"c\": [\"ArrayRemove\", 1, 2, 3]}}", | ||
"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.c", | ||
"removeAllFromArray": { | ||
"values": [ | ||
{ | ||
"integerValue": "1" | ||
}, | ||
{ | ||
"integerValue": "2" | ||
}, | ||
{ | ||
"integerValue": "3" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
dev/conformance/conformance-tests/create-arrayremove-noarray-nested.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"tests": [ | ||
{ | ||
"description": "create: ArrayRemove cannot be anywhere inside an array value", | ||
"comment": "There cannot be an array value anywhere on the path from the document\nroot to the ArrayRemove. Firestore transforms don't support array indexing.", | ||
"create": { | ||
"docRefPath": "projects/projectID/databases/(default)/documents/C/d", | ||
"jsonData": "{\"a\": [1, {\"b\": [\"ArrayRemove\", 1, 2, 3]}]}", | ||
"isError": true | ||
} | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
dev/conformance/conformance-tests/create-arrayremove-noarray.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"tests": [ | ||
{ | ||
"description": "create: ArrayRemove cannot be in an array value", | ||
"comment": "ArrayRemove must be the value of a field. Firestore\ntransforms don't support array indexing.", | ||
"create": { | ||
"docRefPath": "projects/projectID/databases/(default)/documents/C/d", | ||
"jsonData": "{\"a\": [1, 2, [\"ArrayRemove\", 1, 2, 3]]}", | ||
"isError": true | ||
} | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
dev/conformance/conformance-tests/create-arrayremove-with-st.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"tests": [ | ||
{ | ||
"description": "create: The ServerTimestamp sentinel cannot be in an ArrayUnion", | ||
"comment": "The ServerTimestamp sentinel must be the value of a field. It may\nnot appear in an ArrayUnion.", | ||
"create": { | ||
"docRefPath": "projects/projectID/databases/(default)/documents/C/d", | ||
"jsonData": "{\"a\": [\"ArrayRemove\", 1, \"ServerTimestamp\", 3]}", | ||
"isError": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"tests": [ | ||
{ | ||
"description": "create: ArrayRemove with data", | ||
"comment": "A key with ArrayRemove is removed from the data in the update \noperation. Instead it appears in a separate Transform operation.", | ||
"create": { | ||
"docRefPath": "projects/projectID/databases/(default)/documents/C/d", | ||
"jsonData": "{\"a\": 1, \"b\": [\"ArrayRemove\", 1, 2, 3]}", | ||
"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" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
69 changes: 69 additions & 0 deletions
69
dev/conformance/conformance-tests/create-arrayunion-multi.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"tests": [ | ||
{ | ||
"description": "create: multiple ArrayUnion fields", | ||
"comment": "A document can have more than one ArrayUnion field.\nSince all the ArrayUnion fields are removed, the only field in the update is \"a\".", | ||
"create": { | ||
"docRefPath": "projects/projectID/databases/(default)/documents/C/d", | ||
"jsonData": "{\"a\": 1, \"b\": [\"ArrayUnion\", 1, 2, 3], \"c\": {\"d\": [\"ArrayUnion\", 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", | ||
"appendMissingElements": { | ||
"values": [ | ||
{ | ||
"integerValue": "1" | ||
}, | ||
{ | ||
"integerValue": "2" | ||
}, | ||
{ | ||
"integerValue": "3" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"fieldPath": "c.d", | ||
"appendMissingElements": { | ||
"values": [ | ||
{ | ||
"integerValue": "4" | ||
}, | ||
{ | ||
"integerValue": "5" | ||
}, | ||
{ | ||
"integerValue": "6" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.