Mongodb – mongoexport on 2.0.4

mongodb

What I'm I missing here? I need data greater that ISODate("2015-01-11T00:39:40.121Z")

I know many forums have different answers for the same issue. But non resolved. Need a different point of view on this.

mongoexport -d central --collection alerts —q '{\"updated_at\":{\$\"gte\": new Date(1420936780121) } }' --csv --out alerts_11_12_Jan_20151.csv
ERROR: too many positional options

Best Answer

When you are exporting to .csv file you should use --field/-f/fieldFile option.

http://docs.mongodb.org/manual/reference/program/mongoexport/

Try this

mongoexport -d central -c alerts -q "{updated_at:{\$gte:new Date(1420936780121)}}" -f --csv --out alerts_11_12_Jan_20151.csv