mongoose-mock icon indicating copy to clipboard operation
mongoose-mock copied to clipboard

newing a mongoose model object sems to throw an error

Open mypark opened this issue 11 years ago • 1 comments

get a TypeError: object is not a function when trying to new a mongoose object.

Using the readme example, if you change it from User.createAndSave to new User({title:'Mr'}) it will throw a not a function error

mypark avatar Jan 03 '15 17:01 mypark

I had the same issue. I think this is a massive bug. Basically the creator of mongoose-mock appears to have confused the notions of Schema and Model. If I had more time, I might fix it with a pull-request, but I'm working on something that needs to be finished today, so I've switched to mockgoose instead.

malcolmocean avatar Apr 06 '15 15:04 malcolmocean