Ram7585741
Posts: 0
Joined: Fri Jun 12, 2015 9:38 pm

importing a collection from csv

Hi,

I have been trying to import a collection from csv file.

All the number type fields in csv is getting imported as string in the collections.

Is there a workaround for this?

Is there a way to change the datatype of the column in a collection after importing data ?

I cant use json format.
reason - I cant risk my data on online csv to json file conversion sites.

thanks

Ram

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

importing a collection from csv

Modelexam - are you sure they're set up in the collection as numbers and not strings? Also, any possibility that values are enclosed in e.g. quotes in the csv file?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

importing a collection from csv

Hi -

Please make sure that your .csv file contains such structure:
pre
"_id:string","acl:object","field:number"
"55a15b9ce4b0a016a272d1ac","","1.0"
"55a15b9de4b0a016a272d1ad","","2.0"
"55a15b9ee4b0a016a272d1ae","","3.0"
/pre

Ram7585741
Posts: 0
Joined: Fri Jun 12, 2015 9:38 pm

importing a collection from csv

Thanks a lot...field:number --- this works now!!

Return to “Issues”