Hi Daniel,

What’s the error you’re getting when you run the command?

It seems there are a few issues with the command you’re using, possibly due to how it was formatted in the forums. Here’s a corrected version that works for me:

mongoexport --db TEST --username user01 --authenticationDatabase=admin --collection history
--query='{"createAt": {"$lt": {"$date": "2020-10-07TT00:00:00.000Z"}}}'
--type=json
--out=/data/db/dump/full_col_activities_hoy.json

Note that the field createAt might be a typo of createdAt.

2 Likes