Reputation: 503
How do I export the parent key(id as string) of a kind??
I have two kinds. Kind A and Kind B. Kind B is a child of Kind A and when I export I want to know the id of Kind A. What should the export transform be for kind B if I want to write A's key which is an id as well as B's id?
- kind: A
connector: csv
connector_options:
property_map:
- property: __key__
external_name: key
export_transform: transform.key_id_or_name_as_string
import_transform: transform.create_foreign_key('key', key_is_id=True)
- kind: B
connector: csv
connector_options:
property_map:
- property: __key__
external_name: key
export_transform: ????
import_transform: transform.create_deep_key(('A', 'a', True),
('B', 'key', True))
Upvotes: 0
Views: 123
Reputation: 503
Here's the answer
export:
- external_name: A
export_transform: transform.key_id_or_name_as_string_n(0)
- external_name: B
export_transform: transform.key_id_or_name_as_string_n(1)
Upvotes: 1