Ensure CONTAINS works correctly with Uuids and Datetimes

Closes 
This commit is contained in:
Tobie Morgan Hitchcock 2023-02-04 08:15:18 +00:00
parent 84b026679f
commit 77da795d24

View file

@ -1181,7 +1181,7 @@ impl Value {
match self {
Value::Strand(v) => match other {
Value::Strand(w) => MATCHER.fuzzy_match(v.as_str(), w.as_str()).is_some(),
_ => MATCHER.fuzzy_match(v.as_str(), other.to_string().as_str()).is_some(),
_ => MATCHER.fuzzy_match(v.as_str(), other.to_raw_string().as_str()).is_some(),
},
_ => self.equal(other),
}
@ -1206,11 +1206,11 @@ impl Value {
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()),
_ => v.to_string().contains(other.to_raw_string().as_str()),
},
Value::Strand(v) => match other {
Value::Strand(w) => v.contains(w.as_str()),
_ => v.contains(other.to_string().as_str()),
_ => v.contains(other.to_raw_string().as_str()),
},
Value::Geometry(v) => match other {
Value::Geometry(w) => v.contains(w),