任何想法如何在单个查询中查询所有孩子和孩子的孩子?
更新
这似乎是一个简单的问题。我怀疑是否有简单的解决方案?
查询文件夹和文件树可能会花费很多API调用。 所以,为了解决我的问题,我使用单个查询来列出所有者的所有文件和文件夹。此查询还会返回子文件和子文件夹。要找到列表中的文件夹及其所有子文件夹(文件夹,文件,子文件夹和子文件),我必须创建一个索引树。 $ b
结论
单个查询是不够的。您必须列出所有者或缩小与所有者的查询。下一步你必须将结果索引到(递归)找到文件夹的树。
像Unix(ls -R)这样的查询选项会很好。
p> 解决方案我认为你在更新中有正确的想法。将驱动器视为平板,拨打电话列出所有内容,并从中生成自己的树。
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.
解决方案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.
更多推荐
如何列出Google驱动器文件夹的所有文件,文件夹,子文件夹和子文件
发布评论