1

My JSON looks like

user1--> 
{"feeds": [{"trait": "ms", "rating": "5", "observation": "fstress", "riskscaling": "3"}, {"trait": "es", "rating": "7", "observation": "abcde", "riskscaling": 6}], "ad_countryCode": "91"}

If I want to find value for a user having fstress then I am using query as-

SELECT DISTINCT globalusers.id 
FROM globalusers 
WHERE (JSON_SEARCH(dynamic_attributes->>'$.feeds[*].observation','all', 'fstress'));

then I am getting my user id but now I want to use regex to find user having {fstress} Any one help?

1
  • care to give an example for such a user? Commented Apr 16, 2021 at 5:31

2 Answers 2

3

Just include the string fstress ?

SELECT globalusers.id FROM `globalusers ` WHERE address REGEXP 'fstress';
Sign up to request clarification or add additional context in comments.

1 Comment

This qry worked for me-->SELECT globalusers.id FROM globalusers WHERE dynamic_attributes->>'$.feeds[*].observation' REGEXP 'fstress';
0

Working Qry for the same--> SELECT globalusers.id FROM globalusers WHERE dynamic_attributes->>'$.feeds[*].observation' REGEXP 'fstress';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.