0

I have the following DB:

"_id" : ...,
"index" : [
    ...,
    ...,
    ...
],
"value" : {
    ...,
    ...,
    ...,
    ...,
    ...,
    ...
}

I want to export all record for which the second element of index is "London" so I used:

mongoexport --db DbReport --collection cityconsumption --query {'index.1':"London"} --csv --out /tmp/me/Query1.csv --username 'DBReport' --password '...' --fields 'index,value'

but I got an error: assertion: 10340 Failure parsing JSON string near: index.1:1^

could you please help me.

Thanks, Amir

Amir
  • 1,017
  • 4
  • 14
  • 32
  • 3
    You should warp `--query` parameter with quotes : `--query "{'index.1':'London'}"` – Ori Dar Jan 28 '14 at 17:34
  • possible duplicate of [mongoexport JSON parsing error](http://stackoverflow.com/questions/8098191/mongoexport-json-parsing-error) – WiredPrairie Jan 28 '14 at 19:47

0 Answers0