Basically, when I was studying the Entity API reference I got confused with “Cricket/Player“ sample. Don’t ask me why.
Something didn’t click there. Perhaps, for me personally I’d rather prefer something like “Company/Employee“ or “Folder/File“ or “CRM/Person“ instead.
Since this is not a straightforward REST API, it takes quite some time with trial & errors, especially at the beginning to making the connections between the entities & their properties on the API level and the actual workspace I have in place. Therefore, visualization could ease getting started.
So, I’d love see how this:
would map to this:
curl -X POST https://YOUR_ACCOUNT.fibery.io/api/commands \
-H 'Authorization: Token YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d \
'[
{
"command": "fibery.entity/query",
"args": {
"query": {
"q/from": "Cricket/Player",
"q/select": [
"fibery/id",
"fibery/public-id",
"Cricket/name",
"Cricket/Full Name",
"Cricket/Born",
"Cricket/Shirt Number",
"Cricket/Height",
"Cricket/Retired?",
{ "Cricket/Batting Hand": ["enum/name"] },
{ "Cricket/Current Team": ["Cricket/name"] },
{ "user/Former Teams": { "q/select": ["Cricket/name"], "q/limit": "q/no-limit" } },
{ "# of former teams": [ "q/count", ["user/Former Teams", "fibery/id"] ] }
],
"q/where": [">=", ["Cricket/Born"], "$birthday" ],
"q/order-by": [
[["Cricket/Height"], "q/desc"],
[["Cricket/Born"], "q/asc"]
],
"q/limit": 3
},
"params": {
"$birthday": "1986-01-01"
}
}
}
]'
Now, I understand the notation a bit more.
What’s confusing though is things like:
"Cricket/name",
"Cricket/Full Name",
In my head name and Full Name belong to the table (Player) - not the database (Cricket). What if we have a table Referee with similar fields like name and Full Name?