search

Home  >  Q&A  >  body text

mongodb - mongodump无法导出数据

用mongodump导出位于服务器上的数据,然后用mongorestore到本地上作调试用,但是用mongodump怎么也无法导出数据,命令如下:mongodump -h localhost:27017 -d xxx -c xx,运行命令后可以看到在当前路径下生成了一个dump文件夹,里面有一个xxx文件夹,但是xxx文件夹里面并没有我想要导出的xx collections,端口是正确的,实在是找不到问题所在

phpcn_u1582phpcn_u15822792 days ago702

reply all(2)I'll reply

  • 为情所困

    为情所困2017-05-02 09:24:24

    I can only say that there are no grammatical errors. If it cannot be exported, it can only be because the database name or collection is wrong.
    Because of the particularity of mongodb, it will not report an error that a certain collection does not exist, but will only export an empty collection.
    Confirm whether the collection or database name is wrong, please connect to the shell first

    show dbs
    show collections

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-02 09:24:24

    In fact, it may be that the data you want to export is too large. I remember that there are restrictions on mongodump export data. You can use mongoexport to try it

    reply
    0
  • Cancelreply