Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Get parent of subdocument #56

Open
rremigius opened this issue Dec 1, 2011 · 4 comments
Open

Get parent of subdocument #56

rremigius opened this issue Dec 1, 2011 · 4 comments

Comments

@rremigius
Copy link

Hi,

I retrieve a Document (Parent) from the database and it contains a DocumentSet. I run through this DocumentSet and pass its elements (let's call them Subs) it on to other classes and methods. In some of these methods, I need the Parent document.

I found a method called isParentDocumentSet, but no method called anything like getParent. If I can't get the Parent directly from the Sub, I would have to pass the parent along with the Sub to all these methods, which I don't feel much for.

Is it possible to get the parent document directly from a sub-document? If not, might that be a good new feature?

Thanks.

@coen-hyde
Copy link
Owner

Hi Remix,

There is no getParent method at the moment but that can certainly be done.

Cheers,
Coen

@rremigius
Copy link
Author

Thanks. I added a 'parent' configAttribute and it works. Are you interested in these changes?

@tholder
Copy link
Collaborator

tholder commented Dec 30, 2011

I've certainly had a need for this, it would be good to get these changes remix. Do you have a forked project?

@rremigius
Copy link
Author

I made a fork. It's located here: https://github.com/remix88/Shanty-Mongo. Hope you find it useful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants