-
|
Beta Was this translation helpful? Give feedback.
Answered by
billy1624
Dec 8, 2021
Replies: 1 comment 2 replies
-
Hi @lz1998, we don't have native support for it but you could do it like below. use sea_query::Expr;
assert_eq!(
cake::Entity::find()
.filter(Expr::cust("category->'$.id' = 1"))
.filter(Expr::cust("category->'$.id'").equals(Expr::val(1)))
.build(DbBackend::MySql)
.to_string(),
"SELECT `cake`.`id`, `cake`.`name` FROM `cake` WHERE category->'$.id' = 1 AND category->'$.id' = 1"
); |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
lz1998
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @lz1998, we don't have native support for it but you could do it like below.