One last question here. Sorry for my questions today! Actually two question 
in one row.

I have jsonb field which is like this:

[
 {
  "name": "Mark",
 },
 {
  "name": "John",
 }
]


As you can see objects are in single array. I want to search John for 
example but i want to use regex like "jo*" or like "%jo%. Using PostgreSQL 
11.

If I learn correctly, regex is not possible directly with* pg_json_op*. If 
so, my question is how can i translate this line to Sequel? I am managed to 
do *SELECT *part and json functions in there but failed on where part.

select (some functions here done by me successfully) from emails where 
EXISTS (SELECT 1 FROM jsonb_array_elements(to) as j(data) WHERE (data#>> 
'{name}') LIKE '%jo%')


Or is there any method in Sequel to help me to accomplish this task? What 
is your suggestion?


-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/d8f7b022-9749-422e-9241-7402444a18ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to