Skip to main content
Version: 0.4.10

Types

MistQL has 8 core datatypes, many of which correspond to their JSON counterparts.

External types are types that can be either provided or returned by a MistQL query. All other types are considered internal and cannot be provided to or returned from MistQL.

TypePrimitiveExternalComment
stringโœ”โœ”Series of unicode codepoints
numberโœ”โœ”Doubles, without NaN or infinity
booleanโœ”โœ”
nullโœ”โœ”
objectโœ”Stringly typed keys
arrayโœ”Can be nonhomogenous
functionArity not part of type system
regex

Type Equality#

Equality in MistQL is strict, meaning that if two variables have different data types, they are considered unequal.

TypeEqualityTruthiness
stringexactfalse if empty, true otherwise
numberIEEE 754 compliantIEEE 754 compliant
booleanexactStandard
nulltruefalse
objectDeep equalityfalse if empty, true otherwise
arrayDeep equalityfalse if empty, true otherwise
functionReferentialtrue
regexOn source and flagtrue

Casting Tables#

MistQL defines casting from some types to other types

TypeCast to FloatCast To String
stringParsed as float, as per JSON standard.noop
numbernoopAs base 10 float. If number is an integer, no trailing digits or decimal. Exponential notation when not within non-inclusive range 1e-7 to 1e21
boolean1 for true, 0 for false"true" for true, "false" for false
null0"null"
objectThrows errorConcise JSON, recursively converting items
arrayThrows errorConcise JSON, recursively converting items
functionThrows errorThrows error
regexThrows errorThrows error