These are chat archives for Automattic/mongoose

4th
Mar 2018
hillct
@hillct
Mar 04 2018 19:30
Good afternoon. I’m receiving a strange error when I call methods attached to an object afixed to my UserSchea via userSchema.methods=myObject. The error I’m getting is "schema.methods[method][k].bind is not a function”. I interpret this to mean I need to wrap myObject in a function that returns myObject, so it can works properly when attached to userSchema.methods. Is that accurate? Is there a better approach?
hillct
@hillct
Mar 04 2018 20:22
Wrapping myObject in a method works, however I’m still interested to know whether there’s a better approach I should consider