0

When I perform a mongodb export query via command prompt

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

C:\WINDOWS\system32>mongo
2015-08-08T22:21:06.874+0530 I CONTROL  Hotfix KB2731284 or later update is inst
alled, no need to zero-out data files
MongoDB shell version: 3.0.4
connecting to: test

> use mydb
switched to db mydb

> db.getCollectionNames()
[ "movie", "student", "system.indexes" ]

> mongoexport --db mydb --collection movie --out movie.json
2015-08-08T22:22:58.897+0530 E QUERY    SyntaxError: Unexpected identifier

> my_path: c:/Program Files/MongoDB/Server/3.0/bin "mongoexport -d mydb -c stude
nt"
2015-08-08T22:40:27.622+0530 E QUERY    SyntaxError: Unexpected string

Why I am not able to perform mongoimport / mongoexport?

feco
  • 4,273
  • 5
  • 28
  • 44
  • Well you did just ask for `-c stude nt` when this should have been `-c student` hence the error of the exact description. – Blakes Seven Aug 08 '15 at 18:08
  • Thanks Blakes For asap reply my_path: C:/Program Files/MongoDB/Server/3.0/bin "mongoexport -d mydb -c student" 015-08-08T23:42:54.182+0530 E QUERY SyntaxError: Unexpected string But still same error – Nisha Sharma Aug 08 '15 at 18:17
  • Sorry by you are not telling the whole truth here. The error comes about because of just like you posted originally you created unexpected arguments. So you still are doing that if you are still getting the error. Read the manual page again and follow the examples to the letter. – Blakes Seven Aug 08 '15 at 18:21
  • Thanks Blakes. Actually I am learner , recently start learning mongoDB, I will appreiciate if you share some good example which help me out – Nisha Sharma Aug 08 '15 at 18:28
  • There are clear examples in the documentation. If you have problems then post your exact actions like you did above. And not in comments. [Edit](http://stackoverflow.com/posts/31896951/edit) your question with details. But honestly, the only errors here are likely typing mistakes. This is not programming, just a command line executuion. Read the documentation and try again. – Blakes Seven Aug 08 '15 at 18:31
  • Possible duplicate http://stackoverflow.com/questions/29431351/mongoexport-e-query-syntaxerror-unexpected-identifier – anhlc Aug 09 '15 at 23:47
  • Possible duplicate of [How to export all collection in mongodb?](http://stackoverflow.com/questions/11255630/how-to-export-all-collection-in-mongodb) – Sk93 Nov 03 '15 at 09:42

0 Answers0