Mongoose throws error on second time with Schema hasn't been registered

34 views
Skip to first unread message

Jimin Park

unread,
Jun 14, 2016, 10:56:44 AM6/14/16
to Mongoose Node.JS ODM
I have posted a question on stack over flow and was wondering if someone could help me out with this problem.


Summary of the problem is here:
I have a schema design where users submit language translation requests. A translation request document has reference to user documents and properties are called "_requester" and "_translator". I want to be able to populate these upon performing some query on translation request collection. Problem happens when I do a certain query, populate the _translator and results look perfect. Then if I do the exact same query it fails second time with the error message sayingSchema hasn't been registered for model "User".

If you would like to see my code, please follow the link to view my stackoverflow post.
Reply all
Reply to author
Forward
0 new messages