{
  "about": "The condition truth table of chapter 04. 'stored' is the record's value: {\"missing\": true} for an attribute the record doesn't have, {\"null\": true} for null. Values are typed: int, text, decimal (as text, exact), bool. Cases marked ignoreCase need case-insensitive text comparison (an implementation that can only compare with case, such as DynamoDB's, refuses those operators and skips these cases).",
  "cases": [
    { "operator": "Equal", "values": [{ "int": 5 }], "stored": { "int": 5 }, "matches": true },
    { "operator": "Equal", "values": [{ "int": 5 }], "stored": { "int": 6 }, "matches": false },
    { "operator": "Equal", "values": [{ "int": 5 }], "stored": { "null": true }, "matches": false },
    { "operator": "Equal", "values": [{ "int": 5 }], "stored": { "missing": true }, "matches": false },
    { "operator": "Equal", "values": [{ "decimal": "1.50" }], "stored": { "decimal": "1.5" }, "matches": true },
    { "operator": "Equal", "values": [{ "bool": true }], "stored": { "bool": true }, "matches": true },
    { "operator": "Equal", "values": [{ "text": "abc" }], "stored": { "text": "abc" }, "matches": true },
    { "operator": "NotEqual", "values": [{ "int": 5 }], "stored": { "int": 6 }, "matches": true },
    { "operator": "NotEqual", "values": [{ "int": 5 }], "stored": { "int": 5 }, "matches": false },
    { "operator": "NotEqual", "values": [{ "int": 5 }], "stored": { "null": true }, "matches": false, "note": "a null never matches a negation" },
    { "operator": "NotEqual", "values": [{ "int": 5 }], "stored": { "missing": true }, "matches": false },
    { "operator": "GreaterThan", "values": [{ "int": 5 }], "stored": { "int": 6 }, "matches": true },
    { "operator": "GreaterThan", "values": [{ "int": 5 }], "stored": { "int": 5 }, "matches": false },
    { "operator": "GreaterThan", "values": [{ "int": 5 }], "stored": { "null": true }, "matches": false },
    { "operator": "GreaterEqual", "values": [{ "int": 5 }], "stored": { "int": 5 }, "matches": true },
    { "operator": "LessThan", "values": [{ "int": 5 }], "stored": { "int": 4 }, "matches": true },
    { "operator": "LessThan", "values": [{ "int": 5 }], "stored": { "missing": true }, "matches": false },
    { "operator": "LessEqual", "values": [{ "int": 5 }], "stored": { "int": 6 }, "matches": false },
    { "operator": "GreaterThan", "values": [{ "decimal": "10" }], "stored": { "decimal": "9.99" }, "matches": false, "note": "numbers by value, not as text" },
    { "operator": "In", "values": [{ "int": 1 }, { "int": 5 }], "stored": { "int": 5 }, "matches": true },
    { "operator": "In", "values": [{ "int": 1 }, { "int": 5 }], "stored": { "int": 2 }, "matches": false },
    { "operator": "In", "values": [{ "int": 1 }], "stored": { "null": true }, "matches": false },
    { "operator": "NotIn", "values": [{ "int": 1 }, { "int": 5 }], "stored": { "int": 2 }, "matches": true },
    { "operator": "NotIn", "values": [{ "int": 1 }, { "int": 5 }], "stored": { "int": 5 }, "matches": false },
    { "operator": "NotIn", "values": [{ "int": 1 }], "stored": { "null": true }, "matches": false },
    { "operator": "Between", "values": [{ "int": 2 }, { "int": 4 }], "stored": { "int": 2 }, "matches": true, "note": "both ends included" },
    { "operator": "Between", "values": [{ "int": 2 }, { "int": 4 }], "stored": { "int": 4 }, "matches": true },
    { "operator": "Between", "values": [{ "int": 2 }, { "int": 4 }], "stored": { "int": 5 }, "matches": false },
    { "operator": "Between", "values": [{ "int": 2 }, { "int": 4 }], "stored": { "null": true }, "matches": false },
    { "operator": "NotBetween", "values": [{ "int": 2 }, { "int": 4 }], "stored": { "int": 5 }, "matches": true },
    { "operator": "NotBetween", "values": [{ "int": 2 }, { "int": 4 }], "stored": { "int": 3 }, "matches": false },
    { "operator": "NotBetween", "values": [{ "int": 2 }, { "int": 4 }], "stored": { "missing": true }, "matches": false },
    { "operator": "Null", "values": [], "stored": { "null": true }, "matches": true },
    { "operator": "Null", "values": [], "stored": { "missing": true }, "matches": true },
    { "operator": "Null", "values": [], "stored": { "int": 0 }, "matches": false },
    { "operator": "Null", "values": [], "stored": { "text": "" }, "matches": false, "note": "empty text isn't null" },
    { "operator": "NotNull", "values": [], "stored": { "int": 0 }, "matches": true },
    { "operator": "NotNull", "values": [], "stored": { "null": true }, "matches": false },
    { "operator": "NotNull", "values": [], "stored": { "missing": true }, "matches": false },
    { "operator": "BeginsWith", "values": [{ "text": "Nor" }], "stored": { "text": "Northwind" }, "matches": true },
    { "operator": "BeginsWith", "values": [{ "text": "nor" }], "stored": { "text": "Northwind" }, "matches": true, "ignoreCase": true },
    { "operator": "BeginsWith", "values": [{ "text": "wind" }], "stored": { "text": "Northwind" }, "matches": false },
    { "operator": "BeginsWith", "values": [{ "text": "50%" }], "stored": { "text": "50% off" }, "matches": true, "note": "the value is text, never a pattern" },
    { "operator": "BeginsWith", "values": [{ "text": "50%" }], "stored": { "text": "500 off" }, "matches": false },
    { "operator": "Contains", "values": [{ "text": "thw" }], "stored": { "text": "Northwind" }, "matches": true },
    { "operator": "Contains", "values": [{ "text": "THW" }], "stored": { "text": "Northwind" }, "matches": true, "ignoreCase": true },
    { "operator": "Contains", "values": [{ "text": "a_c" }], "stored": { "text": "abc" }, "matches": false, "note": "an underscore is itself" },
    { "operator": "Contains", "values": [{ "text": "x" }], "stored": { "missing": true }, "matches": false },
    { "operator": "DoesNotContain", "values": [{ "text": "x" }], "stored": { "text": "Northwind" }, "matches": true },
    { "operator": "DoesNotContain", "values": [{ "text": "x" }], "stored": { "null": true }, "matches": false },
    { "operator": "DoesNotBeginWith", "values": [{ "text": "Nor" }], "stored": { "text": "Northwind" }, "matches": false },
    { "operator": "DoesNotBeginWith", "values": [{ "text": "Nor" }], "stored": { "text": "Contoso" }, "matches": true },
    { "operator": "EndsWith", "values": [{ "text": "wind" }], "stored": { "text": "Northwind" }, "matches": true, "ignoreCase": true, "note": "DynamoDB has no ends_with: refused there" },
    { "operator": "Like", "values": [{ "text": "N%d" }], "stored": { "text": "Northwind" }, "matches": true, "ignoreCase": true },
    { "operator": "Like", "values": [{ "text": "N_rthwind" }], "stored": { "text": "Northwind" }, "matches": true, "ignoreCase": true },
    { "operator": "NotLike", "values": [{ "text": "C%" }], "stored": { "text": "Northwind" }, "matches": true, "ignoreCase": true }
  ]
}
