Reference documentation and code samples for the Firestore in Datastore mode V1 API class Google::Cloud::Datastore::V1::Key::PathElement.
A (kind, ID/name) pair used to construct a key path.
If either name or ID is set, the element is complete.
If neither is set, the element is incomplete.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#id
defid()->::Integer
Returns
(::Integer) — The auto-allocated ID of the entity.
Never equal to zero. Values less than zero are discouraged and may not
be supported in the future.
Note: The following fields are mutually exclusive: id, name. If a field in that set is populated, all other fields in the set will automatically be cleared.
#id=
defid=(value)->::Integer
Parameter
value (::Integer) — The auto-allocated ID of the entity.
Never equal to zero. Values less than zero are discouraged and may not
be supported in the future.
Note: The following fields are mutually exclusive: id, name. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::Integer) — The auto-allocated ID of the entity.
Never equal to zero. Values less than zero are discouraged and may not
be supported in the future.
Note: The following fields are mutually exclusive: id, name. If a field in that set is populated, all other fields in the set will automatically be cleared.
#kind
defkind()->::String
Returns
(::String) — The kind of the entity.
A kind matching regex __.*__ is reserved/read-only.
A kind must not contain more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
#kind=
defkind=(value)->::String
Parameter
value (::String) — The kind of the entity.
A kind matching regex __.*__ is reserved/read-only.
A kind must not contain more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
Returns
(::String) — The kind of the entity.
A kind matching regex __.*__ is reserved/read-only.
A kind must not contain more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
#name
defname()->::String
Returns
(::String) — The name of the entity.
A name matching regex __.*__ is reserved/read-only.
A name must not be more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
Note: The following fields are mutually exclusive: name, id. If a field in that set is populated, all other fields in the set will automatically be cleared.
#name=
defname=(value)->::String
Parameter
value (::String) — The name of the entity.
A name matching regex __.*__ is reserved/read-only.
A name must not be more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
Note: The following fields are mutually exclusive: name, id. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::String) — The name of the entity.
A name matching regex __.*__ is reserved/read-only.
A name must not be more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
Note: The following fields are mutually exclusive: name, id. If a field in that set is populated, all other fields in the set will automatically be cleared.
[[["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-09-04 UTC."],[],[],null,["# Firestore in Datastore mode V1 API - Class Google::Cloud::Datastore::V1::Key::PathElement (v1.4.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.1 (latest)](/ruby/docs/reference/google-cloud-datastore-v1/latest/Google-Cloud-Datastore-V1-Key-PathElement)\n- [1.4.0](/ruby/docs/reference/google-cloud-datastore-v1/1.4.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [1.3.1](/ruby/docs/reference/google-cloud-datastore-v1/1.3.1/Google-Cloud-Datastore-V1-Key-PathElement)\n- [1.2.0](/ruby/docs/reference/google-cloud-datastore-v1/1.2.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [1.1.0](/ruby/docs/reference/google-cloud-datastore-v1/1.1.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [1.0.1](/ruby/docs/reference/google-cloud-datastore-v1/1.0.1/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.19.0](/ruby/docs/reference/google-cloud-datastore-v1/0.19.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.18.0](/ruby/docs/reference/google-cloud-datastore-v1/0.18.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.17.0](/ruby/docs/reference/google-cloud-datastore-v1/0.17.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.16.3](/ruby/docs/reference/google-cloud-datastore-v1/0.16.3/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.15.0](/ruby/docs/reference/google-cloud-datastore-v1/0.15.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.14.0](/ruby/docs/reference/google-cloud-datastore-v1/0.14.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.13.1](/ruby/docs/reference/google-cloud-datastore-v1/0.13.1/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.12.0](/ruby/docs/reference/google-cloud-datastore-v1/0.12.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.11.1](/ruby/docs/reference/google-cloud-datastore-v1/0.11.1/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.10.0](/ruby/docs/reference/google-cloud-datastore-v1/0.10.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.9.0](/ruby/docs/reference/google-cloud-datastore-v1/0.9.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.8.0](/ruby/docs/reference/google-cloud-datastore-v1/0.8.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.7.0](/ruby/docs/reference/google-cloud-datastore-v1/0.7.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.6.0](/ruby/docs/reference/google-cloud-datastore-v1/0.6.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.5.0](/ruby/docs/reference/google-cloud-datastore-v1/0.5.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.4.0](/ruby/docs/reference/google-cloud-datastore-v1/0.4.0/Google-Cloud-Datastore-V1-Key-PathElement)\n- [0.3.5](/ruby/docs/reference/google-cloud-datastore-v1/0.3.5/Google-Cloud-Datastore-V1-Key-PathElement) \nReference documentation and code samples for the Firestore in Datastore mode V1 API class Google::Cloud::Datastore::V1::Key::PathElement.\n\nA (kind, ID/name) pair used to construct a key path.\n\n\n\u003cbr /\u003e\n\nIf either name or ID is set, the element is complete.\nIf neither is set, the element is incomplete. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #id\n\n def id() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- The auto-allocated ID of the entity.\n\n Never equal to zero. Values less than zero are discouraged and may not\n be supported in the future.\n\n Note: The following fields are mutually exclusive: `id`, `name`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #id=\n\n def id=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- The auto-allocated ID of the entity.\n\n\n Never equal to zero. Values less than zero are discouraged and may not\n be supported in the future.\n\nNote: The following fields are mutually exclusive: `id`, `name`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::Integer) --- The auto-allocated ID of the entity.\n\n Never equal to zero. Values less than zero are discouraged and may not\n be supported in the future.\n\n Note: The following fields are mutually exclusive: `id`, `name`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #kind\n\n def kind() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The kind of the entity.\n\n A kind matching regex `__.*__` is reserved/read-only.\n A kind must not contain more than 1500 bytes when UTF-8 encoded.\n Cannot be `\"\"`.\n\n Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\n encoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\n bytes.\n\n### #kind=\n\n def kind=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The kind of the entity.\n\n\n A kind matching regex `__.*__` is reserved/read-only.\n A kind must not contain more than 1500 bytes when UTF-8 encoded.\n Cannot be `\"\"`.\n\n Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\n encoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\nbytes. \n**Returns**\n\n- (::String) --- The kind of the entity.\n\n A kind matching regex `__.*__` is reserved/read-only.\n A kind must not contain more than 1500 bytes when UTF-8 encoded.\n Cannot be `\"\"`.\n\n Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\n encoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\n bytes.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The name of the entity.\n\n A name matching regex `__.*__` is reserved/read-only.\n A name must not be more than 1500 bytes when UTF-8 encoded.\n Cannot be `\"\"`.\n\n Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\n encoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\n bytes.\n\n Note: The following fields are mutually exclusive: `name`, `id`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #name=\n\n def name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The name of the entity.\n\n\n A name matching regex `__.*__` is reserved/read-only.\n A name must not be more than 1500 bytes when UTF-8 encoded.\n Cannot be `\"\"`.\n\n Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\n encoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\n bytes.\n\nNote: The following fields are mutually exclusive: `name`, `id`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::String) --- The name of the entity.\n\n A name matching regex `__.*__` is reserved/read-only.\n A name must not be more than 1500 bytes when UTF-8 encoded.\n Cannot be `\"\"`.\n\n Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\n encoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\n bytes.\n\n Note: The following fields are mutually exclusive: `name`, `id`. If a field in that set is populated, all other fields in the set will automatically be cleared."]]