FAQ
Hi

I am new to mongodb. When i tried to import csv data into a collection, i
get this error: unexpected identifier
I have attached a screenshot for the same. Please someone help me with this
issue.

Should i specify any path for this csv file. As of now my csv file is on
desktop location and i didn't provide any path for it.
Is it correct to save it in the desktop or should i save it in a different
location.

mongoimport --db users --collection contacts --type csv --file /opt/backups/contacts.csv

Also I didn't understand this /opt/backups/contacts.csv



Thanks
Gopichand J

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

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Asya Kamsky at Aug 12, 2013 at 3:53 am
    The file you are importing needs to be at the location that's
    specified right after `--file`

    But your problem isn't the syntax, it's that you are trying to run the
    `mongoimport` command from the `mongo` shell. You should be running
    it from the OS prompt - it's a utility/program not a command inside
    the shell.

    Asya

    On Sun, Aug 11, 2013 at 10:11 AM, Gopichand J wrote:
    Hi

    I am new to mongodb. When i tried to import csv data into a collection, i
    get this error: unexpected identifier
    I have attached a screenshot for the same. Please someone help me with this
    issue.

    Should i specify any path for this csv file. As of now my csv file is on
    desktop location and i didn't provide any path for it.
    Is it correct to save it in the desktop or should i save it in a different
    location.

    mongoimport --db users --collection contacts --type csv --file
    /opt/backups/contacts.csv

    Also I didn't understand this /opt/backups/contacts.csv



    Thanks
    Gopichand J

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

    ---
    You received this message because you are subscribed to the Google Groups
    "mongodb-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    You received this message because you are subscribed to the Google
    Groups "mongodb-user" group.
    To post to this group, send email to mongodb-user@googlegroups.com
    To unsubscribe from this group, send email to
    mongodb-user+unsubscribe@googlegroups.com
    See also the IRC channel -- freenode.net#mongodb

    ---
    You received this message because you are subscribed to the Google Groups "mongodb-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kannan Sathish at Sep 1, 2013 at 4:43 pm
    Hi All

        I was running mongoimport --help in mongo.exe,it is throwing syntaxerror
    - undefined identifier

        even running mongoimport in mongo.exe is also throwing same error.

         awaiting for ur help...
    On Sunday, 11 August 2013 22:41:40 UTC+5:30, Gopichand J wrote:

    Hi

    I am new to mongodb. When i tried to import csv data into a collection, i
    get this error: unexpected identifier
    I have attached a screenshot for the same. Please someone help me with
    this issue.

    Should i specify any path for this csv file. As of now my csv file is on
    desktop location and i didn't provide any path for it.
    Is it correct to save it in the desktop or should i save it in a different
    location.

    mongoimport --db users --collection contacts --type csv --file /opt/backups/contacts.csv

    Also I didn't understand this /opt/backups/contacts.csv



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

    ---
    You received this message because you are subscribed to the Google Groups "mongodb-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Asya Kamsky at Sep 1, 2013 at 7:21 pm
    mongoimport is not a Mongo shell command, it's an operating system command.

    Just like you run mongo.exe to start the shell from OS prompt, you should
    run mongoimport the same way from OS prompt. Example:

    c:\mongodb\bin> mongoimport.exe --help



    On Sun, Sep 1, 2013 at 12:17 AM, Kannan Sathish wrote:

    Hi All

    I was running mongoimport --help in mongo.exe,it is throwing
    syntaxerror - undefined identifier

    even running mongoimport in mongo.exe is also throwing same error.

    awaiting for ur help...

    On Sunday, 11 August 2013 22:41:40 UTC+5:30, Gopichand J wrote:

    Hi

    I am new to mongodb. When i tried to import csv data into a collection, i
    get this error: unexpected identifier
    I have attached a screenshot for the same. Please someone help me with
    this issue.

    Should i specify any path for this csv file. As of now my csv file is on
    desktop location and i didn't provide any path for it.
    Is it correct to save it in the desktop or should i save it in a
    different location.

    mongoimport --db users --collection contacts --type csv --file /opt/backups/contacts.csv

    Also I didn't understand this /opt/backups/contacts.csv



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

    ---
    You received this message because you are subscribed to the Google Groups
    "mongodb-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    You received this message because you are subscribed to the Google
    Groups "mongodb-user" group.
    To post to this group, send email to mongodb-user@googlegroups.com
    To unsubscribe from this group, send email to
    mongodb-user+unsubscribe@googlegroups.com
    See also the IRC channel -- freenode.net#mongodb

    ---
    You received this message because you are subscribed to the Google Groups "mongodb-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmongodb-user @
categoriesmongodb
postedAug 11, '13 at 7:17p
activeSep 1, '13 at 7:21p
posts4
users4
websitemongodb.org
irc#mongodb

People

Translate

site design / logo © 2022 Grokbase