Useful functions for MongoDB shell