Operations
When performing a where or value condition, an operation needs to be supplied.
When an operator is selected with the exception of the kind of operator, a comparison value type and value must be supplied. For more on how these work, see the Condition values section.
There are several operations that can be performed:
Operation | Description | Notes |
---|---|---|
< | less than | Follows standard Javascript comparisons of values |
<= | less than or equal | Follows standard Javascript comparisons of values |
== | equals | Performs deep equality |
!= | doesn't equal | Performs deep inequality |
>= | greater than or equal | Follows standard Javascript comparisons of values |
> | greater than | Follows standard Javascript comparisons of values |
contains | an array contains a value | Value must be an array, does not work on other iterables |
contains any | an array contains any of an array of values | The provided value must be an array in JSON notation |
in | the value matches on of the supplied array of values | The provided value must be an array in JSON notation |
not in | the value does not match any of the supplied array of values | The provided value must be an array in JSON notation |
matches | the string value matches the regular expression | The provided value must be in the format of the Javascript RegEx literal (e.g. /^test/ ) |
kind of | the value is of the specified kind | See below for details on how this operator works |
kind of operator
The kind of operator is used to compare the kind of the target value to the
selected kind. The kind of operator is designed to classify values in the form
of the unique types that Deno KV supports storing, which are those types
supported by
structured clone.
You can consider it a combination of the typeof
operator and the instanceof
operator. For values that are typeof "object"
all other cloneable object types
are eliminated leaving what would be considered a POJO.
The different kinds supported are:
Kind | Description |
---|---|
bigint |
Equivalent of typeof value === "bigint" |
boolean |
Equivalent of typeof value === "boolean" |
number |
Equivalent of typeof value === "number" |
string |
Equivalent of typeof value === "string" |
undefined |
Equivalent of typeof value === "undefined" |
null |
Equivalent of value === null |
object |
When typeof === "object" and all other cloneable types are eliminated |
Array |
Equivalent of Array.isArray(value) |
Map |
Equivalent of value instanceof Map |
Set |
Equivalent of value instanceof Set |
RegExp |
Equivalent of value instanceof RegExp |
Date |
Equivalent of value instanceof Date |
KvU64 |
Equivalent of value instanceof Deno.KvU64 |
ArrayBuffer |
Equivalent of value instanceof ArrayBuffer |
DataView |
Equivalent of value instanceof DataView |
Int8Array |
Equivalent of value instanceof Int8Array |
Uint8Array |
Equivalent of value instanceof Uint8Array |
Uint8ClampedArray |
Equivalent of value instanceof Uint8ClampedArray |
Int16Array |
Equivalent of value instanceof Int16Array |
Uint16Array |
Equivalent of value instanceof Uint16Array |
Int32Array |
Equivalent of value instanceof Int32Array |
Uint32Array |
Equivalent of value instanceof Uint32Array |
Float32Array |
Equivalent of value instanceof Float32Array |
Float64Array |
Equivalent of value instanceof Float64Array |
BigInt64Array |
Equivalent of value instanceof BigInt64Array |
BigUint64Array |
Equivalent of value instanceof BigUint64Array |
Error |
When value instanceof Error and all other cloneable error types have been eliminated |
EvalError |
Equivalent of value instanceof EvalError |
RangeError |
Equivalent of value instanceof RangeError |
ReferenceError |
Equivalent of value instanceof ReferenceError |
SyntaxError |
Equivalent of value instanceof SyntaxError |
TypeError |
Equivalent of value instanceof TypeError |
URIError |
Equivalent of value instanceof URIError |