Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongoexport is not working for collection

I am trying to export a Collection like this:

C:\Program Files\ConEmu>mongoexport --db test --collection person --out personTest.json
connected to: 127.0.0.1
couldn't open [personTest.json]

It is not working. Any suggestions?

like image 365
Andre Avatar asked Oct 09 '14 10:10

Andre


2 Answers

You most likely are doing this from a non-elevated command prompt, and are denied to write in Program Files.

You can:

  • Supply a full path to a directory where you can write, --out C:\Temp\personTest.json
  • cd to a directory where you can write and call the executable by full path: C:\Program Files\ConEmu\mongoexport ...
  • Execute your command from an elevated prompt.
like image 134
CodeCaster Avatar answered Sep 27 '22 22:09

CodeCaster


You do not have write permission in this directory. Change your current location to your home directory or some other directory where you have write permission.e.g My Documents, or Desktop , or user/Andre

like image 39
DhruvPathak Avatar answered Sep 27 '22 22:09

DhruvPathak