Skip to content
Advertisement

How to setup properties on CSV import in OrientDB?

I have a CSV file like:

And I am importing it into OrientDB like:

I would like to set the import so that it created properties so that FN becomes first_name, MI becomes middle_name and so on, as well as set some values to lowercase. For ex: Carolina to become carolina

I could probably make this changes from the SCHEMA once the data is added. My reason to do this here is that I have multiple CSV files and I want to keep the the same schema for all

Any ideas?

Advertisement

Answer

To rename a field, take a look at the Field transformer:

http://orientdb.com/docs/last/Transformer.html#field-transformer

Rename the field from salary to renumeration:

in the same way, you can apply the lowerCase function to the property

{field: {fieldName:'name', expression: '$input.name.toLowerCase()'}}

Try it and let me know if it works.

Advertisement