-
-
Save iTrauco/517bfc4f7c824df014a90dc286b603a9 to your computer and use it in GitHub Desktop.
Export Postgresql for mongoimport
This file contains 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
COPY ( | |
SELECT | |
userid AS "userId.auto()", | |
'some-static-string' AS "__classname__.auto()", | |
failed_login_count AS "failedLoginCount.int32()", | |
CASE WHEN mail_validated=TRUE THEN 'TRUE' ELSE 'FALSE' END AS "mailValidated.boolean()", | |
-42 AS "answers.toTheQuestion.int32()", | |
'Slate Star Codex' AS "answers.niceBlog.auto()" | |
FROM | |
users.accounts | |
) TO '/tmp/users-accounts.csv' WITH (FORMAT CSV, HEADER TRUE, DELIMITER E'\t'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment