Aashu
Aashu

Reputation: 1287

mongoimport from CSV created only DB not collection

c:/review.csv contains(9 records)

**member_id product_id  date1   no_helpfeedback no_feedback rating  title body**
  A1004AX2J2HXGL    B0007RT9LC  May 30, 2005    3   4   5   The film //text
 A1004AX2J2HXGL B00028HBKM    January 17, 2005  9   22  1      Life beyond   //text

on cmd

 C:\>mongoimport --db Amazondb --collection review --type csv --fieldFile /test2.csv
 connected to: 127.0.0.1
 -                                               #blinking
 Clt+c

in mogo cmd

  > show dbs
  Amazondb        (empty)
  local   0.078125GB
  mydb    0.203125GB
  mydbs   0.203125GB
  test    0.203125GB
  > use Amazondb
  switched to db Amazondb
  > db.collection.find()
  > show collections
  >

i waited for 5 minutes then i pressed clt+c ,i am working on windows, my Amazondb db is created but there is not collection as it is showing in db shows (empty) and other db.collection.find()/show collections also,please help me out ,where am i making mistakes.Thanks.

Upvotes: 0

Views: 195

Answers (1)

Ori Dar
Ori Dar

Reputation: 19020

You forgot the --file option

This way (no file given) mongoimport is waiting for data feed via stdin. This is why you had to use Clt+c for interrupt.

Add --file c:/review.csv to mongoimport command line

Upvotes: 1

Related Questions