-
-
Notifications
You must be signed in to change notification settings - Fork 415
Open
Description
Hello, I have some data like
{
"318":{
"cid":8,
"xPath":"//*[@id=\"app\"]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/p[411]"
},
"329":{
"cid":7,
"xPath":""
}
}var readPostion = await _context.UserData.Where(x => x.UserId == userId)
.Select(x => x.ReadPosition[bid.ToString()])
.FirstOrDefaultAsync();ReadPosition is JObject, bid is int
They generated sql statements like this
SELECT JSON_EXTRACT(`u`.`read_position`, '$.318')
FROM `user_data` AS `u`
WHERE `u`.`user_id` = 2
LIMIT 1and throw an error Invalid JSON path expression. The error is around character position 5.
The correct one should be like this
SELECT JSON_EXTRACT(`u`.`read_position`, '$."318"')
FROM `user_data` AS `u`
WHERE `u`.`user_id` = 2
LIMIT 1Is this a bug, or am I missing something?
Reactions are currently unavailable