Mongoimport 找不到文件?

时间:2021-05-25 17:02:11

标签: json mongodb 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

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

1 个答案:

答案 0 :(得分:0)

%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"