Closed NathanBland closed 8 years ago
What process are you going through to get this error? I've been trying to replicate it, but I haven't had any luck.
Ooops. This bug is actually fixed. My bad. The issue was this.model('User')
should have had user being lowercase. There was no race condition like I thought.
We have a race condition as an issue here with this following function and I'm not sure how to solve it.
The issue occurs when we try to use the
getUser
query. One of two problems presents itself, either mongoose complains that the schema isn't yet registered, or that theUser
object doesn't have a find method. I believe I'm using the recommend method as described here so I'm not quite sure what to do about this, other than creating an abstraction layer that goes between the model and the routes file, but I'm not sure I like that idea either.