We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there, Wrong operator for $in function.
Correction: ... "$in", value) => OpValValue::In(into_values(value)?), ...
... "$in", value) => OpValValue::In(into_values(value)?), ...
impl OpValueToOpValType for OpValValue { fn op_value_to_op_val_type(op: &str, value: Value) -> Result<Self> where Self: Sized, { fn into_values(value: Value) -> Result<Vec<Value>> { let mut values = Vec::new(); let Value::Array(array) = value else { return Err(Error::JsonValArrayWrongType { actual_value: value }); }; for item in array.into_iter() { values.push(item) } Ok(values) } let ov = match (op, value) { ("$eq", v) => OpValValue::Eq(v), ("$in", value) => OpValValue::NotIn(into_values(value)?), <<<---- Should be OpValValue::In ("$not", v) => OpValValue::Not(v), ("$notIn", value) => OpValValue::NotIn(into_values(value)?), ("$lt", v) => OpValValue::Lt(v), ("$lte", v) => OpValValue::Lte(v), ("$gt", v) => OpValValue::Gt(v), ("$gte", v) => OpValValue::Gte(v), ("$null", Value::Bool(v)) => OpValValue::Null(v), (_, v) => { return Err(Error::JsonOpValNotSupported { operator: op.to_string(), value: v, }) } }; Ok(ov) } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi there,
Wrong operator for $in function.
Correction:
... "$in", value) => OpValValue::In(into_values(value)?), ...
The text was updated successfully, but these errors were encountered: