It appears that you have a database called ds:
> use ds
switched to db ds
use ds switches the current database to the ds database (db from the shell is just an alias for the current database).
Then, you have a collection called ds as well:
So, that means you have a ds database with a ds collection (ds.ds).
You should then use the export like this with the --db option set to ds (assuming the path to the database is correct):
mongoexport --db ds --collection ds --dbpath ~/db --out ds.json
it doesn't work for me, i still have the same msg "exported 0 records"
@Tmp mongoexpert is not to type in mongoshell. It should be type in bash. so if you give --out (or - o ) with only file name, it'll be create where your terminal is (pwd = present working directory)