0

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.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

thanks orid ,but can you explain me ,how come the empty database is created and when it is taking a path from fieldfile ?
fieldfile is not a path to data file, but field name headers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.