MongoImport syntax error?

2,783 views
Skip to first unread message

sh

unread,
Nov 23, 2012, 6:02:27 AM11/23/12
to mongodb-user
Hi,

I'm trying to load up a simple csv file of 5 columns, 4m rows (no
nulls in the set).

mongoimport --db db --collection PDI_Test --type csv --file C:
\delme.csv

But i get Syntaxerror: missing ; before statement (shell):1

I can't see anything wrong with the command?

Also, must there be a pre-existing collection/schema to insert into,
or will MongoDB create one if needed?

Thanks
Stuart

Ross Lawley

unread,
Nov 23, 2012, 9:56:00 AM11/23/12
to mongod...@googlegroups.com
There should be a mongoimport.exe file to run - this isn't run via the javascript shell.

MongoDB will create the database and collection for you when you run mongoimport.exe :)

Ross

Sam Millman

unread,
Nov 23, 2012, 11:21:29 AM11/23/12
to mongod...@googlegroups.com
Though I have noticed your confusion: http://docs.mongodb.org/manual/reference/mongoimport/

Nowhere there does it say it is an external program that is run externally to the console. It says it is a "utility" however that is quite vague English.


--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

Ross Lawley

unread,
Nov 23, 2012, 1:24:57 PM11/23/12
to mongod...@googlegroups.com
Good point Sam!  I've added a ticket so the documentation can be improved.  (https://jira.mongodb.org/browse/DOCS-787)
Reply all
Reply to author
Forward
0 new messages