Added subcommand that export json and mongodb.