Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEMaaCS - Asset/Metadata list

Avatar

Level 4
Level 4

Hi, 

Our requirement is to get the list of all the available assets and metadata from /content/dam/wknddemo path. 

Currently, I use the below[1] query to get the list, but we are migrating to AEMaaCS, so I would like to know what are the options available to achieve the given requirement. 
 
 
Thanks

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

Please use below query in Query Debugger to fetch all the Assets :

 

path=/content/dam
type=dam:Asset
p.limit=-1

 

Query debugger Path : /libs/cq/search/content/querydebug.html

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi,

 

Please use below query in Query Debugger to fetch all the Assets :

 

path=/content/dam
type=dam:Asset
p.limit=-1

 

Query debugger Path : /libs/cq/search/content/querydebug.html

Avatar

Community Advisor

Use below query to get all assets and metadata from dam path. 

 

type=dam:Asset
path=/content/dam/<project>
p.hits=selective
p.properties=jcr:content/metadata/dc:format  jcr:content/metadata/dam:size

In above query i am fetching format and size. Click on JSON QueryBuilder Link to view metadata json

 

HeenaMadan_1-1663856807178.png

Json Response like this:

{"jcr:content":{"metadata":{"dam:size":649544,"dc:format":"image/jpeg"}}}

 

Avatar

Level 4
Level 4

@ksh_ingole7  @HeenaMadan thank you for your time and reply. 

 

I am running the query(given in the original post) successfully in AEM(On-prem) environment without any issues.  However, I wanted to make sure it was the right way to get an asset list from AEMaaCS or need to go with AssetHTTP API. 

 

@kautuk_sahni    Thank you in advance for any suggestions you may have.