Type conversion
Any value from SurrealDB is converted into a JavaScript type automatically, and the return value from the JavaScript function is converted to a SurrealQL value. Boolean values, Integers, Floats, Strings, Arrays, Objects, and Date objects are all converted automatically to and from SurrealQL values.
In addition, a number of special classes are included within the JavaScript functions for the additional types which are not built into JavaScript. These enable the creation of duration values, record ids, and UUID values from within JavaScript.
Any values of these types passed into embedded scripting functions are also represented with these special classes.