importJson failed which include mongo date type file
Posted by: MIN SOO CHO
Date: October 01, 2019 02:45AM

Hi,
I tried importing https://raw.githubusercontent.com/mongodb/docs-assets/primer-dataset/primer-dataset.json file as following :

util.importJson("/home/mysql/primer-dataset.json",{collection:"restaurants",convertBsonTypes:true})ut

but the following error occurred :

Importing from file "/home/mysql/primer-dataset.json" to collection `testdb`.`restaurants` in MySQL Server at mysqlgr1:33060


Processed 0 bytes in 0 documents in 0.0013 sec (0.00 documents/s)
Total successfully imported documents 0 (0.00 documents/s)
Util.importJson: Unexpected data, expected to find a string processing extended JSON for $date at offset 189 (ArgumentError)

When I change convertBsonTypes:true to false, the import was successful but $date data are inserted as is.

How can I convert $date format? and how to find the exact error?

Options: ReplyQuote


Subject
Views
Written By
Posted
importJson failed which include mongo date type file
1521
October 01, 2019 02:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.