Reputation: 11706
Any ideas how to query for all the children and the children of the children in a single query?
Update
It seems like a simple question. I doubt if there is a simple solution?
Quering the tree of folders and files can cost a lot of API calls. So, to solve my problem, I use a single query to list all the files and folders of an owner. This query also returns subfiles and subfolders. To find the folder and all of its children (folder, files, subfolders and subfiles) in the list, I had to create a tree like index.
Conclusion
A single query is not enough. You have to list all or narrow the query with an owner. Next You have to index the results to (recursive) find the tree for the folder.
A query option like (ls -R in Unix) would be nice.
Upvotes: 1
Views: 5580
Reputation: 21
I'm trying to do the same in PHP. My solution is:
rejecting all the elements that not contain the id of my specific folder in its parents id list.
Don't worry, it's just one Google APIs call. The rest of the job is local.
Upvotes: 2
Reputation: 41633
I think you have the right idea in your "update". Treat Drive as flat, make calls to list everything, and generate your own tree from that.
Upvotes: 1