The property ref must receive the name of the schema you added in mongoose.model, not the name of the class you created.
For example, if your Comment schema is exporting the following: mongoose.model("comments"), then your ref should be: 'ref': 'comments'.
Let me know if that makes sense and if it solves the problem :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Aleksandar,
The property
ref
must receive the name of the schema you added inmongoose.model
, not the name of the class you created.For example, if your Comment schema is exporting the following:
mongoose.model("comments")
, then your ref should be:'ref': 'comments'
.Let me know if that makes sense and if it solves the problem :)