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

Infinite resource depth #87

Open
yjaaidi opened this issue Nov 18, 2014 · 2 comments
Open

Infinite resource depth #87

yjaaidi opened this issue Nov 18, 2014 · 2 comments

Comments

@yjaaidi
Copy link
Contributor

yjaaidi commented Nov 18, 2014

Hi,

For our app wishtack.com, we need to support infinite depth resources like "/blogs/.../posts/.../comments/..." and there are probably many people out there who need this.

In order to solve this, we had to implement a bunch of Resource mixins.

Are you planning something concerning this? Otherwise, we can work on integrating this in django-tastypie-mongoengine and make a pull request.

Thanks!

@danstovall
Copy link
Contributor

I didn't have any plans for that personally. Currently, I plan on adding querying abilities for those nested resources (/blogs/.../posts/.../coments/?date__lt=2014-08-11) and keeping it current with the latest versions of mongoengine, tastypie and django. Past that, I don't have much of a roadmap for it. I was just added as an admin for the project and it currently meets most of use cases I have for it. It is fine with me if you want make a pull request and start adding those capabilities. I definitely don't want to see this project go stale, but my needs for it right now are pretty much all met.

Other admins on the project may have other opinions.

@mitar
Copy link
Member

mitar commented Nov 30, 2014

I have not get request for this before, so I am not sure how asked is this. I think the main reason is that it is not really normal to have too nested MongoDB documents. Often you then split your database structure into multiple documents/collections and you do request from client against multiple REST endpoints.

If you instead of highly nested documents you have in mind references and resolving them on-the-fly, then I would also caution against this. As it currently stands, it would probably happen that for each reference you would make one MongoDB query to the database. So if you would open a list of 100 documents, which have each one reference to a document, you would be making 101 queries to MongoDB to get this through REST.

So in both cases it is a question how good it is that you have such schema.

But yes, pull requests are welcome. :-)

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

No branches or pull requests

3 participants