Skip to content

Instantly share code, notes, and snippets.

@mlehman
Last active December 14, 2015 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlehman/e90ddeb50309bd0279b4 to your computer and use it in GitHub Desktop.
Save mlehman/e90ddeb50309bd0279b4 to your computer and use it in GitHub Desktop.
MongoDB to Extended JSON with SED
sed -e 's/NumberLong("*\(-*[[:digit:]]*\)"*)/{ "$numberLong" : "\1" }/' -e 's/ObjectId("*\([[:alnum:]]*\)"*)/{ "$oid" : "\1
" }/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment