Mongimport csv with milliseconds of 9 positions

Hi All.

I`m trying to import a document with thousand of lines generated by oracle dump “backup”, like below:

“24/10/16 00:00:00.000000000”,4,"Jovem ",1,“teste”,1,1,“BRANCA”,1,“MASCULINO”,“NORTE”,“RO”,“RONDONIA”,“COLORADO DO OESTE”,-13.1305638414553,-60.5550674630789,
“22/01/17 00:00:00.000000000”,4,"Jovem ",5,“teste”,2,1,“BRANCA”,1,“MASCULINO”,“NORTE”,“RO”,“RONDONIA”,“COLORADO DO OESTE”,-13.1305638414553,-60.5550674630789,

The problem is even specifying the date_oracle white as the acceptable oracle date format I`m getting a transformation error during the import.

mongoimport mongodb+srv://***********.mongodb.net -u ************ -p *********** --authenticationDatabase admin --db test --collection alteracao --drop --file sample.csv --type=csv --columnsHaveTypes --fields=“field1.date_oracle(DD/MM/YY HH24:MM:SS.FF9),field2.int32(),field3.string(),field4.int32(),field5.string(),field6.int32(),field7.int32(),field8.string(),field9.int32(),field10.string(),field11.string(),field12.string(),field13.string(),field14.string(),field15.decimal(),field16.decimal()”

In my mind, considering mongoimport documentation, any date format accepted by Oracle is possible to be imported.

Are my thoughts correct? Do we have any limitations regarding the format process acceptable by mongoimport?

Hi @Felipe_Cabral1 welcome to the community!

In my mind, considering mongoimport documentation, any date format accepted by Oracle is possible to be imported.

Unfortunately I don’t think this is true. The database tools are written in Go, so any compatibility with any other database products not under MongoDB’s control (such as Oracle) would be limited.

The mongoimport manual gave an example of a compatible Oracle-style format:

created.date_oracle(YYYY-MM-DD HH24:MI:SS)

and specifically linked to Oracle’s TO_DATE format. So for best results, you may want to create the data dump using this particular format.

Best regards
Kevin