Skip to content

Instantly share code, notes, and snippets.

@djsipe
Last active June 27, 2017 17:14
Show Gist options
  • Save djsipe/6d7a428e88b923a3a8694ae55b4250a3 to your computer and use it in GitHub Desktop.
Save djsipe/6d7a428e88b923a3a8694ae55b4250a3 to your computer and use it in GitHub Desktop.

To convert you should run a regex find/replace.

Pattern:

[a-zA-Z]+\(([^\)]+)\)

Replace with:

$1

This scans through the BSON and replaces all the ISODate(), ObjectId(), NumberLong(), and other object references into plain strings or numbers containing whatever was inside the parentheses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment