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.

4

1 回答 1

1

您忘记了 --file 选项

这种方式(没有给出文件)mongoimport 正在等待通过标准输入的数据馈送。这就是为什么您必须使用 Clt+c 进行中断。

添加--file c:/review.csv到 mongoimport 命令行

于 2013-08-13T16:48:56.963 回答