List

Here is the detailed description of the “List” endpoint in Gyxi DB.

For a full overview of the API, please see the documentation here:
https://api.gyxi.com

The List endpoint gets a list of items from Gyxi.

In other databases it might be referred to as a “query” but it is called “list” in Gyxi DB because it is queryless.

Later in this article it will be described how to list data from a view. But first, here is the URL to call the List endpoint to get your base data.

GET https://germany-list.gyxi.com/[databaseId]/[type]/[partition]

germany can be replaced by one of the other available regions.

[databaseId] is a short name that identifies your database

[type] is the type of data you are saving, like a class name or table name.

[partition] is the key from where you want to retrieve (or list) the data.

Example

For example, maybe your company is a European company headquartered in Germany, so you have your data there. Now you want to get all employees from the London department.

The URL might look like this:

GET https://germany-list.gyxi.com/mydb/employee/london

The response might look something like this.

{
"result": [
{
"name": "Paul McCartney",
"department": "WestEurope"
},
{
"name": "Boris Johnson",
"department": "WestEurope"
}
],
"nextPageToken": null
}

The endpoint will return up to 1000 results in a single call. If there are any more results, the nextPageToken will contain a string that needs to be passed to the API to get the next list of items.

The next call might look like this:

GET https://germany-list.gyxi.com/mydb/employee/london/123abcdefxyz

Where 123abcdefxyz is the content of the nextPageToken in this case.

The real nextPageToken is somewhat longer.

This call will get the next 1000 items and if there are still more items, then a new nextPageToken will be returned.

List from a View

It is easy to list data from a view. It works the same way as described above, but the URL is slightly different:

GET https://germany-list.gyxi.com/mydb/employee/view/BySkill/programming

In this example, mydb is the database and employee is the type as before.

The word “view” here indicates that we are now going to look up data from a view.

BySkill is the name of the view.

And finally, programming is the partition. The view “BySkill” was set up to partition by “skill”, which is a field with an array content, and that made it possible to find all employees with a certain skill.