Mongoose Schema hasn't been registered for model

前端 未结 17 872
猫巷女王i
猫巷女王i 2020-11-27 15:00

I\'m learning the mean stack and when I try to start the server using

npm start

I get an exception saying that:

schema has         


        
17条回答
  •  情书的邮戳
    2020-11-27 15:43

    My problem was sort out using the below

    adminModel.findById(req.params.id).populate({ path: "users", model: userModel //User collection name })

提交回复
热议问题