GRAB
The main action is GRAB, this will parse files and return data.
Basic
Here's how to return all User without any filtering:
To get all User above 30 years old:
To return only the member name of User:
To return the 10 first User:
You can combine these options:
Use multiple conditions:
GRAB queries return a list of JSON objects with the data inside, e.g:
[{id:"1e170a80-84c9-429a-be25-ab4657894653", name: "Gwendolyn Ray", age: 70, email: "austin92@example.org", scores: [ 77 ], friends: [], }, ]
Ordering - Not yet implemented
To order the results by name:
Array
You can use the IN operator to check if something is in an array:
Relationship
2 main things to remember with relationship:
- You can use filter inside filter.
- You can use the dot
.to refer to a relationship. (Not yet implemented)
Get User that have a best friend named Adrien:
You can specify how much data to return and which members to include, even for links. In this example, I get 1 friend's name for 10 User:
When using IN, it return all User that have AT LEAST one friend named Adrien:
To get User with all friends named Adrien:
You can use ! to say not in:
Dot - Not yet implemented
You can use . if you just want to do one comparison. Here I get all User that ordered at least one book:
Same as:
You can also use the dot like that:
The filter is done on User but it return Order. It return all Order from User named 'Bob'.