微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Mongoimport 找不到文件?

如何解决Mongoimport 找不到文件?

mongoimport --uri mongodb+srv://gtye:<PASSWORD>@dxgraph.rymok.mongodb.net/dxgraph-db --collection dxgraph-collection --type json --file ~/DxHero%20Godot/Data/postgres_export.json

返回

2021-05-25T12:58:05.538-0400    Failed: open /Users/gtye/DxHero%20Godot/Data/postgres_export.json: no such file or directory
2021-05-25T12:58:05.538-0400    0 document(s) imported successfully. 0 document(s) Failed to import.

但我知道它在那里!!

enter image description here

在这里!!到底是怎么回事?

解决方法

%20 是一种 URI 转义机制。它在 shell 中不起作用。

试试:

mongoimport --uri mongodb+srv://gtye:<PASSWORD>@dxgraph.rymok.mongodb.net/dxgraph-db --collection dxgraph-collection --type json --file ~/"DxHero Godot/Data/postgres_export.json"

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。