What is the best method to seeding a Node / MongoDB application?

前端 未结 4 1398
一个人的身影
一个人的身影 2021-02-05 11:15

So, I\'m new to the MEAN stack, and I\'ve hit a wall trying to seed MongoDB. I\'m using Mongoose to communicate with the database, and there\'s a bunch of documentation suggesti

4条回答
  •  借酒劲吻你
    2021-02-05 11:49

    You can populate MongoDB in the CLI using mongoimport

    It will load a JSON file into a specified MongoDB Instance & Collection, all you need is for a mongod instance to be running before executing.

    Here is a walkthrough of using mongoimport.

提交回复
热议问题