set key with new bulkloader

一世执手 提交于 2019-12-12 01:35:11

问题


I am converting a script to use the new bulkloader. (What was wrong with the original bulkloader? - I prefer writing Python to editing configuration files...)

Anyway, I want to prevent duplicates by assigning a combination of properties to the key. The docs say:

If you want to use or calculate a key from the import data, specify a key using the same syntax as the property map; that is, external_name, import_template, and so on.

All the examples apply a transform to the current property. How do I instead use a combination of other properties?

Should be something like:

- property: __key__
  external_name: key
  import_transform: entity.first_name + entity.last_name

回答1:


You can do this using the 'import_template' property (documented here) instead of 'import_transform':

- property: __key__
  import_template: "%(first_name)s %(last_name)s"


来源:https://stackoverflow.com/questions/3920171/set-key-with-new-bulkloader

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!