无法导入 Mongodb Atlas Cluster 中正确集合中的文档

Unable to import documents in the right collection in Mongodb Atlas Cluster

我想在 'node-angular' 的 'posts' 集合中导入 3 个文档的 JSON 文件。

我运行下面的命令,导入了文件;然而,它们被创建为不同的命名空间。

mongoimport --host <primary cluster name> --collection posts --type json --file C:/Users/H182720/Desktop/testcontent.json --jsonArray --authenticationDatabase admin --ssl –username <username> --password <password> 

如能提供有关如何在 'node-angular' 的 'posts' 集合中导入 JSON 文档的任何指导,我们将不胜感激。

 mongoimport --host <primary cluster name> --collection posts 
--type json --file C:/Users/H182720/Desktop/testcontent.json --jsonArray 
--authenticationDatabase admin --ssl –username <username> --password <password>  
--db node-angular

这会将文档导入到 node-angular 数据库的 posts 集合中。