You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

This is a collection of mini-recipes for doing JCR queries. Please add your own!

 

SQL

JCR (deprecated in JCR 2.0)

Get all pages

select * from mgnl:content

//element(*, mgnl:content)

Get all pages with "News" in the title

select * from mgnl:content where title like '%News%'

//element(*, mgnl:content)jcr:like(@title, '%News%')

Get all pages where the title exactly matches "News" (case sensitive)

select * from mgnl:content where title like 'News'

//element(*, mgnl:content)@title = 'News'

Get all STK pages that have a header image

select * from mgnl:content where image is not null

//element(*, mgnl:content)@image

Note: you can use the translator to convert from one format to another.

  • No labels