algolia / algolia-csv-js

CSV toolbox CLI written in javascript
11 stars 4 forks source link

Support uploading nested data via CSV #13

Open hkdobrev opened 4 years ago

hkdobrev commented 4 years ago

CSV upload in Algolia dashboard does not allow to upload nested hierarchical data. The documentation says there is no agreed format for nesting data in CSV.

However, would you consider this tool to allow selecting columns which contain JSON to be uploaded as-is. E.g. you have a CSV in tabular format and then specific columns to be parsed as raw nested structures and be sent to Algolia like that.

What do you think?

name brand categories
Foo Acme {"lvl0": "Home", "lvl1": "Seating", "lvl2": "Chairs"}
Haroenv commented 4 years ago

The dashboard doesn't use this library. Is this a feature request for the dashboard or the cli?

hkdobrev commented 4 years ago

@Haroenv This is a feature request for this CLI library as the dashboard doesn't support it and I imagine this feature to be for more tech-savvy users.

hkdobrev commented 4 years ago

I imagine the usage like:

algolia-upload ... --raw-column=categories
Haroenv commented 4 years ago

Makes sense. Implementation would be something like: https://github.com/algolia/algolia-csv-js/blob/master/lib/import.js#L53

I'd make it just raw though (for consistency with the other options).

Do you want to make a PR?

hkdobrev commented 4 years ago

I'll try to create a PR in the next few days.