Last active
February 20, 2018 10:41
-
-
Save nhc/0b399b6659683b9d274e30eff80c304a to your computer and use it in GitHub Desktop.
Import CSV Into Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker cp /Users/developer/Downloads/lists-data.csv apimkmbscouk_mongodb_1:/home/ | |
$ docker-compose exec mongodb mongoimport -d mkmdev -c lists_old --type csv --file /home/lists-data.csv --headerline | |
## In order to force the fields to be of a datatype (for leading zero's on columnns) chanmge to the following | |
docker-compose exec mongodb mongoimport -d mkmdev -c lists_old --type csv --file /home/lists-data.csv --columnsHaveTypes --fields "AccountNo.string(),AccountName.string(),WishListName.string(),Created.string(),SKU.string(),ProductTitle.string(),Quantity.int32()" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment