Getting error while mongoexport

hi, I have done importing csv file and made changes and when I am trying to export using the command “–mongoexport --db=users --collection=contacts --type=csv --fields=Name,Department,DOJ --out=contacts.csv”
its is showing
connected to: mongodb://localhost/
error opening output stream: open contacts.csv: Access is denied.

Hi @Aman_N_A and welcome in the MongoDB Community :muscle: !

It’s not something like by any chance?

chmod 644 contacts.csv

If the file exists… Or maybe you are in a folder where you don’t have write authorization? Go to /tmp or your home ~/.

Cheers,
Maxime.

1 Like