I want to perform the mongoexport functionality within a java program. That is I want something similar to mongoexport -db myDatabase --collection Page --out Page.json
Is there a way this can be done using java programming?
Runtime.getRuntime().exec("mongoexport --host host_name --port port_number --db myDatabase --collection Page --out Page.json");
See Runtime, and mongodb should be added in your environmental variables.