The query 2 from the examples (in the embedded Surrealist instance) for the Surreal Deal Store demo data looks like this:
-- Query 2: Using graph relations to select from the person and product table
SELECT
order_date,
product_name,
<-person.name as person_name,
->product.description
FROM order LIMIT 4;
The order doesn't have order_date field. It has time.created_at
The product doesn't have description. Could use name instead?
Proposed fix:
SELECT
time.created_at,
product_name,
(<-person.name)[0] as person_name,
(->product.name)[0] as product_name
FROM order LIMIT 4;
The relation queries are also wrapped in parenthesis with [0] at the end to extract the first (and only) element to reduce unnecessary array wrappers. This produces:
Description
The query 2 from the examples (in the embedded Surrealist instance) for the Surreal Deal Store demo data looks like this:
which returns:
Problems:
order
doesn't haveorder_date
field. It hastime.created_at
description
. Could usename
instead?Proposed fix:
The relation queries are also wrapped in parenthesis with
[0]
at the end to extract the first (and only) element to reduce unnecessary array wrappers. This produces:Is there an existing issue for this?
Code of Conduct