...
# | Json Data | CPS-PATH Syntax | Output | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Below is the sample data ,
| <cps-path>(contains'[@leafname,'<string-value>']')
|
|
Native Query for contains keyword
...
# | Query | Output | Decision | |||||
---|---|---|---|---|---|---|---|---|
1 | cpsdb=# SELECT * FROM FRAGMENT WHERE anchor_id = 4 and attributes->>'lang' like '%en%'; |
| ||||||
2 | cpsdb=# SELECT * FROM FRAGMENT WHERE anchor_id = 4 and attributes->>'lang' ilike '%En%'; |
| As per discussion , with Toine Siebelink Contains Xpath is case sensitive , So ilike keyword would be suitable to implement the contains query which support case sensitive attribute values | |||||
3 | cpsdb=# SELECT * FROM FRAGMENT WHERE anchor_id = 4 and attributes->>'lang' like 'en'; |
|
...
# | Query | Output | |||||
---|---|---|---|---|---|---|---|
1 | cpsdb=# SELECT * FROM FRAGMENT WHERE anchor_id = 3 and attributes->>'pub_year'similar to '%(94|95)%'; |
|
...