英文:
Loading childrens with properties[Eager Loading] with Nuxeo Rest Api
问题
Sure, here are the translations:
-
获取报告文档的基本内容:http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report
-
获取报告文档的基本内容以及所有属性:http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report?properties=*
-
获取报告文档的基本内容以及其所有子文档及其基本内容:http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report?enrichers.document=children
-
获取报告文档的基本内容以及所有属性,以及其所有子文档及其基本内容:http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report?enrichers.document=children&properties=*
现在,我如何才能获取其所有子文档的属性呢?
英文:
> 1) http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report
gives me basic content of Report document
> 2)http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report?properties=*
gives me basic+all properties of Report document
> 3)http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report?enrichers.document=children
gives me basic content of Report document and all its children document with its basic content
> 4)http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report?enrichers.document=children&properties=*
gives me basic+all properties of Report document and all its children document with its basic content
Now how can I get properties of all its children as well?
答案1
得分: 3
我找到了解决方案。我们需要指定 'depth' 标头来控制聚合深度。
尽管文档建议默认情况下深度设置为 children。但对于我来说,明确将 "depth" 设置为 "children" 或 "max" 有效。
http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report?enrichers.document=children&properties=*&depth=children
英文:
I found the solution.We need to specify 'depth' header to control aggregation depth
Though documentation suggest depth is set to children by default. But for me
specifying "depth" explicitly to "children" or "max" worked
http://host:port/nuxeo/api/v1/path/default-domain/workspaces/Report?enrichers.document=children&properties=*&depth=children
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论