Aug 29th, 2022
session
functions for retrieving session variables—ns
and —db
arguments optional in command-line REPLmath::sum()
returns a number instead of a NONE
value, when called on a non-array valueSurrealDB now supports the ability to define record IDs using arrays and objects. These values sort correctly, and can be used to store values or recordings in a timeseries context.
// Create a record with a complex ID using an array CREATE temperature:['London', '2022-08-29T08:03:39'] SET location = 'London', date = '2022-08-29T08:03:39', temperature = 23.7 ; // Create a record with a complex ID using an object CREATE temperature:{ location: 'London', date: '2022-08-29T08:03:39' } SET location = 'London', date = '2022-08-29T08:03:39', temperature = 23.7 ; // Select a specific record using a complex ID SELECT * FROM temperature:['London', '2022-08-29T08:03:39'];
SurrealDB now supports the ability to query a range of records, using the record ID. The record ID ranges, retrieve records using the natural sorting order of the record IDs. With the addition of complex record IDs above, this can be used to query a range of records in a timeseries context.
// Select all person records with IDs between the given range SELECT * FROM person:1..1000; // Select all temperature records with IDs between the given range SELECT * FROM temperature:['London', '2022-08-29T08:03:39']..['London', '2022-08-29T08:09:31'];