The document's fields.
The map keys represent field names.
A simple field name contains only characters a to z, A to Z,
0 to 9, or , and must not start with 0 to 9. For example,
foo_bar_17.
Field names matching the regular expression _.*__ are reserved. Reserved
field names are forbidden except in certain documented contexts. The map
keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
empty.
Field paths may be used in other contexts to refer to structured fields
defined here. For map_value, the field path is represented by the simple
or quoted field names of the containing fields, delimited by .. For
example, the structured field
"foo" : { map_value: { "x&y" : { string_value: "hello" }}} would be
represented by the field path foo.x&y.
Within a field path, a quoted field name starts and ends with and
may contain any character. Some characters, including , must be
escaped using a \. For example, x&y represents x&y and
bak\tik represents baktik ``.
The time at which the document was created.
This value increases monotonically when a document is deleted then
recreated. It can also be compared to values from other documents and
the read_time of a query.
The time at which the document was created.
This value increases monotonically when a document is deleted then
recreated. It can also be compared to values from other documents and
the read_time of a query.
The document's fields.
The map keys represent field names.
A simple field name contains only characters a to z, A to Z,
0 to 9, or , and must not start with 0 to 9. For example,
foo_bar_17.
Field names matching the regular expression _.*__ are reserved. Reserved
field names are forbidden except in certain documented contexts. The map
keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
empty.
Field paths may be used in other contexts to refer to structured fields
defined here. For map_value, the field path is represented by the simple
or quoted field names of the containing fields, delimited by .. For
example, the structured field
"foo" : { map_value: { "x&y" : { string_value: "hello" }}} would be
represented by the field path foo.x&y.
Within a field path, a quoted field name starts and ends with and
may contain any character. Some characters, including , must be
escaped using a \. For example, x&y represents x&y and
bak\tik represents baktik ``.
The document's fields.
The map keys represent field names.
A simple field name contains only characters a to z, A to Z,
0 to 9, or , and must not start with 0 to 9. For example,
foo_bar_17.
Field names matching the regular expression _.*__ are reserved. Reserved
field names are forbidden except in certain documented contexts. The map
keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
empty.
Field paths may be used in other contexts to refer to structured fields
defined here. For map_value, the field path is represented by the simple
or quoted field names of the containing fields, delimited by .. For
example, the structured field
"foo" : { map_value: { "x&y" : { string_value: "hello" }}} would be
represented by the field path foo.x&y.
Within a field path, a quoted field name starts and ends with and
may contain any character. Some characters, including , must be
escaped using a \. For example, x&y represents x&y and
bak\tik represents baktik ``.
The document's fields.
The map keys represent field names.
A simple field name contains only characters a to z, A to Z,
0 to 9, or , and must not start with 0 to 9. For example,
foo_bar_17.
Field names matching the regular expression _.*__ are reserved. Reserved
field names are forbidden except in certain documented contexts. The map
keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
empty.
Field paths may be used in other contexts to refer to structured fields
defined here. For map_value, the field path is represented by the simple
or quoted field names of the containing fields, delimited by .. For
example, the structured field
"foo" : { map_value: { "x&y" : { string_value: "hello" }}} would be
represented by the field path foo.x&y.
Within a field path, a quoted field name starts and ends with and
may contain any character. Some characters, including , must be
escaped using a \. For example, x&y represents x&y and
bak\tik represents baktik ``.
The document's fields.
The map keys represent field names.
A simple field name contains only characters a to z, A to Z,
0 to 9, or , and must not start with 0 to 9. For example,
foo_bar_17.
Field names matching the regular expression _.*__ are reserved. Reserved
field names are forbidden except in certain documented contexts. The map
keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
empty.
Field paths may be used in other contexts to refer to structured fields
defined here. For map_value, the field path is represented by the simple
or quoted field names of the containing fields, delimited by .. For
example, the structured field
"foo" : { map_value: { "x&y" : { string_value: "hello" }}} would be
represented by the field path foo.x&y.
Within a field path, a quoted field name starts and ends with and
may contain any character. Some characters, including , must be
escaped using a \. For example, x&y represents x&y and
bak\tik represents baktik ``.
The time at which the document was last changed.
This value is initially set to the create_time then increases
monotonically with each change to the document. It can also be
compared to values from other documents and the read_time of a query.
The time at which the document was last changed.
This value is initially set to the create_time then increases
monotonically with each change to the document. It can also be
compared to values from other documents and the read_time of a query.
The time at which the document was created.
This value increases monotonically when a document is deleted then
recreated. It can also be compared to values from other documents and
the read_time of a query.
The time at which the document was last changed.
This value is initially set to the create_time then increases
monotonically with each change to the document. It can also be
compared to values from other documents and the read_time of a query.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Interface DocumentOrBuilder (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.firestore.v1.DocumentOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.firestore.v1.DocumentOrBuilder)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.firestore.v1.DocumentOrBuilder) \n\n public interface DocumentOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### containsFields(String key)\n\n public abstract boolean containsFields(String key)\n\nThe document's fields.\nThe map keys represent field names.\nA simple field name contains only characters `a` to `z`, `A` to `Z`,\n`0` to `9`, or , and must not start with `0` to `9`. For example,\n`foo_bar_17`.\nField names matching the regular expression `_.*__` are reserved. Reserved\nfield names are forbidden except in certain documented contexts. The map\nkeys, represented as UTF-8, must not exceed 1,500 bytes and cannot be\nempty.\nField paths may be used in other contexts to refer to structured fields\ndefined here. For `map_value`, the field path is represented by the simple\nor quoted field names of the containing fields, delimited by `.`. For\nexample, the structured field\n`\"foo\" : { map_value: { \"x&y\" : { string_value: \"hello\" }}}` would be\nrepresented by the field path `foo.x&y`.\nWithin a field path, a quoted field name starts and ends with ` `` `` and\nmay contain any character. Some characters, including `` ` `, must be\nescaped using a ``\\``. For example, `` ``x&y`` `` represents ``x&y`` and\n`` ``bak\\``tik`` `` represents `` bak`tik \\`\\`.\n\n`map\u003cstring, .google.events.cloud.firestore.v1.Value\u003e fields = 2;`\n\n### getCreateTime()\n\n public abstract Timestamp getCreateTime()\n\nThe time at which the document was created.\nThis value increases monotonically when a document is deleted then\nrecreated. It can also be compared to values from other documents and\nthe `read_time` of a query.\n\n`.google.protobuf.Timestamp create_time = 3;`\n\n### getCreateTimeOrBuilder()\n\n public abstract TimestampOrBuilder getCreateTimeOrBuilder()\n\nThe time at which the document was created.\nThis value increases monotonically when a document is deleted then\nrecreated. It can also be compared to values from other documents and\nthe `read_time` of a query.\n\n`.google.protobuf.Timestamp create_time = 3;`\n\n### getFields()\n\n public abstract Map\u003cString,Value\u003e getFields()\n\nUse [#getFieldsMap()](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.firestore.v1.DocumentOrBuilder#com_google_events_cloud_firestore_v1_DocumentOrBuilder_getFieldsMap__) instead.\n\n### getFieldsCount()\n\n public abstract int getFieldsCount()\n\nThe document's fields.\nThe map keys represent field names.\nA simple field name contains only characters `a` to `z`, `A` to `Z`,\n`0` to `9`, or , and must not start with `0` to `9`. For example,\n`foo_bar_17`.\nField names matching the regular expression `_.*__` are reserved. Reserved\nfield names are forbidden except in certain documented contexts. The map\nkeys, represented as UTF-8, must not exceed 1,500 bytes and cannot be\nempty.\nField paths may be used in other contexts to refer to structured fields\ndefined here. For `map_value`, the field path is represented by the simple\nor quoted field names of the containing fields, delimited by `.`. For\nexample, the structured field\n`\"foo\" : { map_value: { \"x&y\" : { string_value: \"hello\" }}}` would be\nrepresented by the field path `foo.x&y`.\nWithin a field path, a quoted field name starts and ends with ` `` `` and\nmay contain any character. Some characters, including `` ` `, must be\nescaped using a ``\\``. For example, `` ``x&y`` `` represents ``x&y`` and\n`` ``bak\\``tik`` `` represents `` bak`tik \\`\\`.\n\n`map\u003cstring, .google.events.cloud.firestore.v1.Value\u003e fields = 2;`\n\n### getFieldsMap()\n\n public abstract Map\u003cString,Value\u003e getFieldsMap()\n\nThe document's fields.\nThe map keys represent field names.\nA simple field name contains only characters `a` to `z`, `A` to `Z`,\n`0` to `9`, or , and must not start with `0` to `9`. For example,\n`foo_bar_17`.\nField names matching the regular expression `_.*__` are reserved. Reserved\nfield names are forbidden except in certain documented contexts. The map\nkeys, represented as UTF-8, must not exceed 1,500 bytes and cannot be\nempty.\nField paths may be used in other contexts to refer to structured fields\ndefined here. For `map_value`, the field path is represented by the simple\nor quoted field names of the containing fields, delimited by `.`. For\nexample, the structured field\n`\"foo\" : { map_value: { \"x&y\" : { string_value: \"hello\" }}}` would be\nrepresented by the field path `foo.x&y`.\nWithin a field path, a quoted field name starts and ends with ` `` `` and\nmay contain any character. Some characters, including `` ` `, must be\nescaped using a ``\\``. For example, `` ``x&y`` `` represents ``x&y`` and\n`` ``bak\\``tik`` `` represents `` bak`tik \\`\\`.\n\n`map\u003cstring, .google.events.cloud.firestore.v1.Value\u003e fields = 2;`\n\n### getFieldsOrDefault(String key, Value defaultValue)\n\n public abstract Value getFieldsOrDefault(String key, Value defaultValue)\n\nThe document's fields.\nThe map keys represent field names.\nA simple field name contains only characters `a` to `z`, `A` to `Z`,\n`0` to `9`, or , and must not start with `0` to `9`. For example,\n`foo_bar_17`.\nField names matching the regular expression `_.*__` are reserved. Reserved\nfield names are forbidden except in certain documented contexts. The map\nkeys, represented as UTF-8, must not exceed 1,500 bytes and cannot be\nempty.\nField paths may be used in other contexts to refer to structured fields\ndefined here. For `map_value`, the field path is represented by the simple\nor quoted field names of the containing fields, delimited by `.`. For\nexample, the structured field\n`\"foo\" : { map_value: { \"x&y\" : { string_value: \"hello\" }}}` would be\nrepresented by the field path `foo.x&y`.\nWithin a field path, a quoted field name starts and ends with ` `` `` and\nmay contain any character. Some characters, including `` ` `, must be\nescaped using a ``\\``. For example, `` ``x&y`` `` represents ``x&y`` and\n`` ``bak\\``tik`` `` represents `` bak`tik \\`\\`.\n\n`map\u003cstring, .google.events.cloud.firestore.v1.Value\u003e fields = 2;`\n\n### getFieldsOrThrow(String key)\n\n public abstract Value getFieldsOrThrow(String key)\n\nThe document's fields.\nThe map keys represent field names.\nA simple field name contains only characters `a` to `z`, `A` to `Z`,\n`0` to `9`, or , and must not start with `0` to `9`. For example,\n`foo_bar_17`.\nField names matching the regular expression `_.*__` are reserved. Reserved\nfield names are forbidden except in certain documented contexts. The map\nkeys, represented as UTF-8, must not exceed 1,500 bytes and cannot be\nempty.\nField paths may be used in other contexts to refer to structured fields\ndefined here. For `map_value`, the field path is represented by the simple\nor quoted field names of the containing fields, delimited by `.`. For\nexample, the structured field\n`\"foo\" : { map_value: { \"x&y\" : { string_value: \"hello\" }}}` would be\nrepresented by the field path `foo.x&y`.\nWithin a field path, a quoted field name starts and ends with ` `` `` and\nmay contain any character. Some characters, including `` ` `, must be\nescaped using a ``\\``. For example, `` ``x&y`` `` represents ``x&y`` and\n`` ``bak\\``tik`` `` represents `` bak`tik \\`\\`.\n\n`map\u003cstring, .google.events.cloud.firestore.v1.Value\u003e fields = 2;`\n\n### getName()\n\n public abstract String getName()\n\nThe resource name of the document. For example:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`\n\n`string name = 1;`\n\n### getNameBytes()\n\n public abstract ByteString getNameBytes()\n\nThe resource name of the document. For example:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`\n\n`string name = 1;`\n\n### getUpdateTime()\n\n public abstract Timestamp getUpdateTime()\n\nThe time at which the document was last changed.\nThis value is initially set to the `create_time` then increases\nmonotonically with each change to the document. It can also be\ncompared to values from other documents and the `read_time` of a query.\n\n`.google.protobuf.Timestamp update_time = 4;`\n\n### getUpdateTimeOrBuilder()\n\n public abstract TimestampOrBuilder getUpdateTimeOrBuilder()\n\nThe time at which the document was last changed.\nThis value is initially set to the `create_time` then increases\nmonotonically with each change to the document. It can also be\ncompared to values from other documents and the `read_time` of a query.\n\n`.google.protobuf.Timestamp update_time = 4;`\n\n### hasCreateTime()\n\n public abstract boolean hasCreateTime()\n\nThe time at which the document was created.\nThis value increases monotonically when a document is deleted then\nrecreated. It can also be compared to values from other documents and\nthe `read_time` of a query.\n\n`.google.protobuf.Timestamp create_time = 3;`\n\n### hasUpdateTime()\n\n public abstract boolean hasUpdateTime()\n\nThe time at which the document was last changed.\nThis value is initially set to the `create_time` then increases\nmonotonically with each change to the document. It can also be\ncompared to values from other documents and the `read_time` of a query.\n\n`.google.protobuf.Timestamp update_time = 4;`"]]