-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded Documents don't have methods defined on their schema #249
Comments
Could anyone point me in the right direction to a fix for this? I'm happy to try and fix it myself.. My code is totally dead in the water right now without this working. Thanks in advance! |
Ahh.. belay that. It looks like you can use virtuals and gets.. but methods defined via "method" don't work. So I can work around it for now. Thanks. |
Here is a patch:
Performance-wise this could be improved by creating the EmbeddedDocument during module compilation. |
+1 to see this get fixed. Instead of patching
|
…nce methods via Schema#method. See GH-249.
This seems to no longer work. |
@jep37 please open a new ticket with a failing test case. include which mongoose version in use |
Nevermind, I didn't realize you had to define the methods on the embedded schema before defining the parent schema. |
The text was updated successfully, but these errors were encountered: