Enable searching within Record IDs using the CONTAINS operator
Closes #1377
This commit is contained in:
parent
8902fc0a70
commit
73bf56810e
1 changed files with 4 additions and 0 deletions
|
@ -1044,6 +1044,10 @@ impl Value {
|
|||
pub fn contains(&self, other: &Value) -> bool {
|
||||
match self {
|
||||
Value::Array(v) => v.iter().any(|v| v.equal(other)),
|
||||
Value::Thing(v) => match other {
|
||||
Value::Strand(w) => v.to_string().contains(w.as_str()),
|
||||
_ => v.to_string().contains(&other.to_string().as_str()),
|
||||
},
|
||||
Value::Strand(v) => match other {
|
||||
Value::Strand(w) => v.contains(w.as_str()),
|
||||
_ => v.contains(&other.to_string().as_str()),
|
||||
|
|
Loading…
Reference in a new issue