The SurrealDB documentation states that the concept of JOINs is replaced through the use of Record links. But is it still possible to JOIN tables based on arbitrary columns?
Consider the following tables:
CREATE user:1 SET
name = 'User1',
favouriteDay = 'Monday'
;
CREATE user:2 SET
name = 'User2',
favouriteDay = 'Tuesday'
;
CREATE motto:1 SET
day = 'Monday',
motto = 'Best day of the week'
;
CREATE motto:2 SET
day = 'Tuesday',
motto = 'Second best day of the week'
;
Is it possible to write a query to get the following result (without changing the underlying data model)?
"result": [
{
"favouriteDay": "Monday",
"id": "user:1",
"name": "User1",
"motto": "Best day of the week"
},
{
"favouriteDay": "Tuesday",
"id": "user:2",
"name": "User2",
"motto": "Second best day of the week"
}
]