Skip to content
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

Single Embedded Subdocs has no parent #5134

Closed
dcharbonnier opened this issue Mar 30, 2017 · 2 comments
Closed

Single Embedded Subdocs has no parent #5134

dcharbonnier opened this issue Mar 30, 2017 · 2 comments
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Milestone

Comments

@dcharbonnier
Copy link

unlike the array of sub-documents there is no access to the parent document with parent(), parent is undefined

@mjoyce91
Copy link

Related? #5113

@sobafuchs
Copy link
Contributor

sobafuchs commented Apr 5, 2017

you can use .ownerDocument(): http://mongoosejs.com/docs/api.html#types_embedded_EmbeddedDocument-ownerDocument

this won't get you the immediate parent doc but the top-level doc. Is that fine for your needs or are you looking for something more?

@sobafuchs sobafuchs added the needs clarification This issue doesn't have enough information to be actionable. Close after 14 days of inactivity label Apr 5, 2017
@vkarpov15 vkarpov15 added this to the 4.9.6 milestone Apr 18, 2017
@vkarpov15 vkarpov15 added enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature and removed needs clarification This issue doesn't have enough information to be actionable. Close after 14 days of inactivity labels Apr 18, 2017
vkarpov15 added a commit that referenced this issue Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Projects
None yet
Development

No branches or pull requests

4 participants