If there's anybody who can point me in the right direction, that would be greatly appreciated
I'm able to import a collection from MongoDB to elasticsearch, with the following transform_file.js code:
t.Source("source", source, '/^categories$/').Save("sink", sink, "/.*/")
In elasticsearch (using appbase.io), the data is indexed with the MongoDB collection 'categories' being the only type, while all the MongoDB documents are elasticsearch documents:
However, I want each of the MongoDB documents to instead be their own elasticsearch type. So instead of 'categories' being the only type in elasticsearch, I want the types to be BMW and Audi. Ideally named category_bmw and category_audi.
I assume it's the code after '.Save' that has to be changed, but I'm not exactly sure what changes to make.
EDIT: I'm using elasticsearch version 5.