Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

#

Query

Output

Decision
1

cpsdb=# SELECT * FROM FRAGMENT WHERE anchor_id = 4 and attributes->>'lang' like '%en%';



Code Block
titleJson Response
collapsetrue
{
 "lang": "en", 
 "price": 699, 
 "title": "The Golden Compass", 
 "authors": [
           "Philip Pullman"
 ], 
"pub_year":1995
}                                                                                                
{
 "lang": "english", 
 "price": 895, 
 "title": "Feersum Endjinn", 
 "authors": [
            "Iain M. Banks"
 ], 
"pub_year":1994
}    
            



2cpsdb=# SELECT * FROM FRAGMENT WHERE anchor_id = 4 and attributes->>'lang' ilike '%En%';


Code Block
titleJson Response
collapsetrue
{
 "lang": "en", 
 "price": 699, 
 "title": "The Golden Compass", 
 "authors": [
           "Philip Pullman"
 ], 
"pub_year":1995
}                                                                                                
{
 "lang": "English", 
 "price": 895, 
 "title": "Feersum Endjinn", 
 "authors": [
            "Iain M. Banks"
 ], 
"pub_year":1994
}              


  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

3cpsdb=# SELECT * FROM FRAGMENT WHERE anchor_id = 4 and attributes->>'lang' like 'en';


Code Block
titleJson Response
collapsetrue
{
 "lang": "en", 
 "price": 699, 
 "title": "The Golden Compass", 
 "authors": [
           "Philip Pullman"
 ], 
"pub_year":1995
}           



...