QueryBuilder API: Query if a specific property exists? | Community
Skip to main content
Level 4
September 27, 2022
Solved

QueryBuilder API: Query if a specific property exists?

  • September 27, 2022
  • 1 reply
  • 2515 views

I want to query in AEM and get all those records where a specific value exists:

 

type=cq:tag path=/content/cq:tags/home p.limit=12 p.offset=0 p.hits=selective p.properties=jcr:title jcr:title.es

 

Here I want to query only those tags where `jcr:title.es` exists. How can I write the query for the same?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

Hi @spidey1405,

You can use exists operation:

So your query could look like this:

type=cq:tag
path=/content/cq:tags/home
p.limit=12
p.offset=0
p.hits=selective
p.properties=jcr:title jcr:title.es
property=jcr:title.es
property.operation=exists

 

1 reply

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
September 27, 2022

Hi @spidey1405,

You can use exists operation:

So your query could look like this:

type=cq:tag
path=/content/cq:tags/home
p.limit=12
p.offset=0
p.hits=selective
p.properties=jcr:title jcr:title.es
property=jcr:title.es
property.operation=exists