I have a JSON array that looks like this:
[
{
"_Id": "0001",
"_PatentId": "0000",
"_Text": "Employee",
"_Value": "employee",
"_PermissionLevel": 55
},
{
"_Id": "0002",
"_PatentId": "0000",
"_Text": "Employees",
"_Value": "employees",
"_PermissionLevel": 55
},
{
"_Id": "0002",
"_PatentId": "0001",
"_Text": "Dept",
"_Value": "Dept",
"_PermissionLevel": 55
}
]
With this JSON array, I am trying to filter employees using the like operator. The query I used below is working as expected.
var qryResult = Enumerable.From(_gramrTree).Where("$._Text == 'Employee'").OrderBy("$._Id").Select("$._Id").ToArray();
However, I also need to use the like operator but it's not giving the desired outcome.
Unsuccessful queries
var qryResult = Enumerable.From(_gramrTree).Where("$._Text like '%Emp%'").OrderBy("$._Id").Select("$._Id").ToArray();
var qryResult = Enumerable.From(_gramrTree).Where("$._Text % 'Emp'").OrderBy("$._Id").Select("$._Id").ToArray();