blob: d05997332df0602d112b53944610de8fa4f670cb [file] [log] [blame]
{
"tests": [
{
"description": "listen: add a doc, modify it, delete it, then add it again",
"comment": "Various changes to a single document.",
"listen": {
"responses": [
{
"documentChange": {
"document": {
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "1"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:01Z"
},
"targetIds": [
1
]
}
},
{
"targetChange": {
"targetChangeType": "CURRENT"
}
},
{
"targetChange": {
"readTime": "1970-01-01T00:00:01Z"
}
},
{
"documentChange": {
"document": {
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "2"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:02Z"
},
"targetIds": [
1
]
}
},
{
"targetChange": {
"readTime": "1970-01-01T00:00:02Z"
}
},
{
"documentDelete": {
"document": "projects/projectID/databases/(default)/documents/C/d1"
}
},
{
"targetChange": {
"readTime": "1970-01-01T00:00:03Z"
}
},
{
"documentChange": {
"document": {
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "3"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:03Z"
},
"targetIds": [
1
]
}
},
{
"targetChange": {
"readTime": "1970-01-01T00:00:04Z"
}
}
],
"snapshots": [
{
"docs": [
{
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "1"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:01Z"
}
],
"changes": [
{
"kind": "ADDED",
"doc": {
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "1"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:01Z"
},
"oldIndex": -1
}
],
"readTime": "1970-01-01T00:00:01Z"
},
{
"docs": [
{
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "2"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:02Z"
}
],
"changes": [
{
"kind": "MODIFIED",
"doc": {
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "2"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:02Z"
}
}
],
"readTime": "1970-01-01T00:00:02Z"
},
{
"changes": [
{
"kind": "REMOVED",
"doc": {
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "2"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:02Z"
},
"newIndex": -1
}
],
"readTime": "1970-01-01T00:00:03Z"
},
{
"docs": [
{
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "3"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:03Z"
}
],
"changes": [
{
"kind": "ADDED",
"doc": {
"name": "projects/projectID/databases/(default)/documents/C/d1",
"fields": {
"a": {
"integerValue": "3"
}
},
"createTime": "1970-01-01T00:00:01Z",
"updateTime": "1970-01-01T00:00:03Z"
},
"oldIndex": -1
}
],
"readTime": "1970-01-01T00:00:04Z"
}
]
}
}
]
}