ran this command, and 0 records were exported. [changed the db and collection names for privacy]. doubled checked the syntax.
mongoexport --db db_name --collection collection_name --out collection_name_delete.json --verbose
2015-10-15T08:18:02.825+0000 connected to: localhost
2015-10-15T08:18:02.825+0000 exported 0 records
root@sever_name:/mnt/data# mongo db_name
MongoDB shell version: 3.0.0
connecting to: db_name
DBReplicaSet:PRIMARY> db.dip_acon_research_finals.count()
1597113
You have a replica set and not a stand alone setup. You must use correct set of switches for connecting to the replica set. Try again with --host and --port arguments. For more reference see https://docs.mongodb.org/manual/reference/program/mongoexport/
The mongoexport syntax looks fine. Since you're using an replica set, modify the syntax like the following and try
mongodump --host "<replSetName>/<hostname1><:port>,<hostname2><:port>,<...>" --db db_name --collection collection_name --out output_file.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With