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
SELECT name, country, region, latitude, longitude | |
INTO OUTFILE '/tmp/dump.csv' | |
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' | |
FROM table | |
-- | |
-- mongoimport -d db_name -c collection_name -type csv -f name,country,region,latitude,longitude --drop /tmp/dump.csv | |
-- | |
/** -- Mongo shell script -- |
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
var fs = require('fs'); | |
/** | |
* Splits whole path into segments and checks each segment for existence and recreates directory tree from the bottom. | |
* If since some segment tree doesn't exist it will be created in series. | |
* Existing directories will be skipped. | |
* @param {String} directory | |
*/ | |
function mkdirSyncRecursive(directory) { | |
var path = directory.replace(/\/$/, '').split('/'); |
NewerOlder