Miguel Carrasco
Miguel Carrasco

Reputation: 181

How to find by a relative path in jcrQuery (Sql2)

I´m trying to find a node by a relative path:

I need to search a node which terminates in : 3265

I´m using queries like that:

SELECT * from [mgnl:news] AS t WHERE ISSAMENODE([/%/3265]) 

I need to know how to find a node by a relative path, thanks

Upvotes: 1

Views: 760

Answers (2)

Miguel Carrasco
Miguel Carrasco

Reputation: 181

That´s the answer:

Select * from [mgnl:news] as t where name(t) = '3265'

This returns my node: /Application/news/3265

Thanks also.

Upvotes: 1

Ducaz035
Ducaz035

Reputation: 3132

You may do something like

Select * from [nt:base] where path like '%.%'

For more examples please have a look at https://wiki.magnolia-cms.com/display/WIKI/JCR+Query+Cheat+Sheet

Cheers,

Upvotes: 0

Related Questions