我希望在“ 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文档的指导将不胜感激。
答案 0 :(得分:1)
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
这会将文档导入posts
数据库的node-angular
集合中。