search

Home  >  Q&A  >  body text

怎样向MongoDB中导入Json文件?

怎样将Json文件导入到MongoDB数据库中?

> show dbs
admin  (empty)
ceshi  0.078GB
local  0.078GB
> use ceshi
switched to db ceshi
> show tables
ganji_info
ganji_uinfo
ganji_url_info
ganji_url_list
prices_list
sample_info
shouji_info
shouji_urls_list
system.indexes
url_list
> mongoimport -d ceshi -c sample_info e:\sample.json
2016-08-18T08:28:00.151+0800 SyntaxError: Unexpected identifier

我参考网上的说是这样做,但是老是出错,求大神告诉我怎么做?

世界只因有你世界只因有你2788 days ago532

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-02 09:23:04

    Damn it, I just said that the more I read, the more something is wrong. I know why you made a mistake in the question. mongoimportThis command is not executed in the mongo shell!
    This command must be executed independently

    reply
    0
  • Cancelreply