INNER CODE UNIT · Rust
parse_list_operator
fcoury/oxide · src/parser/mod.rs:114
fn parse_list_operator(list_oper: ListOperator, field: String) -> Result<String> {
match list_oper.operator.as_str() {
"$in" | "$nin" => {
let values: Vec<serde_json::Value> = list_oper
.values
.into_iter()
.map(|leaf_value| leaf_value.value)
.collect();
let jsonb_field = if field.contains(".") {
let fields = field
.split(".")
.collect::<Vec<&str>>()
.iter()
.map(|f| format!("'{}'", f))
.collect::<Vec<String>>()
.join("->>");
format!("_jsonb->{}", fields)
} else {