1

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
1

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

  • Adding to above, the time should be in milliseconds which you have to specify and not in ISO format which you can convert on any epoch time converter website – Puneet Jindal Jun 16 '15 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.