Note that there are some explanatory texts on larger screens.

plurals
  1. POmongoexport syntax error message
    text
    copied!<p>I'm working with mongodb 2.4.3 and I cannot get mongoexport to work. The error message I get with each command is: <code>"JavaScript execution failed: SyntaxError: Unexpected identifier"</code></p> <p>At first I thought the problem was with my query parameters, which were long. But find() worked fine with the query so I know that the syntax is ok. I then created a new collection using the query and tried exporting the collection with the following:</p> <p><code>mongoexport --db Oct2012 --collection sept8subset --csv --fields "text","created_at","user.screen_name","user.followers_count" --out sept8.csv</code></p> <p><code>mongoexport --db Oct2012 --collection sept8subset --csv --fields text,created_at,user.screen_name,user.followers_count --out sept8.csv</code></p> <p><code>mongoexport -d Oct2012 -c sept8subset --csv --fields text,created_at,user.screen_name -o sept8.csv</code></p> <p><code>mongoexport --db Oct2012 --collection sept8subset --dbpath ~/db (should need dbpath as mongod instance is running)</code></p> <p><code>mongoexport --db OCt2012 -collection sept8subset -o sept8.txt</code></p> <p><code>mongoexport --db Oct2012 --collection sept8subset</code></p> <p>In each case, I get <code>"JavaScript execution failed: SyntaxError: Unexpected identifier"</code>. Where could that SyntaxError be??</p> <p>The collection I'm trying to copy has 50,339 objects. In case it is just too big for mongoexport to handle, I took 5 documents out of the collection to make a new collection. I then tried to export them using same command structure as above. I still get the same error message.</p> <p>Now I'm wondering if the problem is that mongoexport can't work with data involving dates. MongoDB documentation states that I may want to write my own export script using a client driver. </p> <p>Does anyone have an idea of what my problem is here? Many thanks if you can help out.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload