-
Notifications
You must be signed in to change notification settings - Fork 0
Functions
Zafar Ansari edited this page Sep 6, 2023
·
7 revisions
Why does time::floor round down to the previous thursday?
Because the 1970-1-1 is a thursday. This is just how it is implemented. As UnixTime is used. To round to sunday you can do
time::floor(date - 3d, 1w) + 3dSELECT * FROM meta::id(person:tobie);
SELECT meta::id(id) FROM person:tobie;The type::point() function expects 2 arguments (both floats). If you pass 1 argument, then it returns a NULL value. If you pass 2 arguments, then it converts each of them into a . When converting null to a it is 0.0.
!!person:john.idThe trick here, is that we use the ! operator twice which will give us back a boolean, and you can directly select properties from a record id. In this case we are selecting the id property, as that always exists on a record.
DEFINE FUNCTION fn::record::exists($id: record) {
RETURN !!$id.id;
};