Created
December 2, 2020 17:14
-
-
Save aspen-roller/37e8b54a8b723ac12d023a2b396b8689 to your computer and use it in GitHub Desktop.
remove _id from mongoexport dump #mongo
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
// dump.json is the result of a mongoexport using --jsonArray | |
cat dump.json | sed '/"_id":/s/"_id":[^,]*,//' > new-dump.json | |
// Regex for global replace | |
"_id":{[^,]+, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment