Proper format for mongoimport --fieldFile

With the following command

mongoimport --db test --collection=entity --type=tsv --fieldFile=entity.ff --columnsHaveTypes --mode=upsert --file=entity_mapping.tsv

I get the following error:

Failed: type 2 does not support arguments

I’m pretty sure that the syntax is correct as it worked for another collection, so it must be my format file (entity.ff)

_id.string()
name.string()
description.string()
is_liquid.boolean()
ndb_no.string()
fdc_id.int64()
alt.string()
approved.boolean()
anydish_category.string()
anydish_category_id.string()
anydish_food_label.string()
is_label_default.boolean()
generic_name.string()
is_generic_default.boolean()

What is wrong with this file?

Hello @Ilan_Toren ,

mongoimport --db=test --collection=entity --type=tsv --fieldFile=entity.ff --columnsHaveTypes --mode=upsert --file=entity_mapping.tsv

Can you try above command? I think you were missing = in --db test.

Regards,
Tarun

1 Like