-
Notifications
You must be signed in to change notification settings - Fork 23
Retrieving
DavidDuwaer edited this page Sep 1, 2017
·
13 revisions
The most simple query is to retrieve all objects of a certain kind.
Artist.get()Because this is not a database query but an API query, results of multiple objects are always paginated. Artist.get() retrieves the first page. Other pages are retrieved like this:
Artist.get(3)...which retrieves the third page. The default page size of the underlying API can be overridden; how this is done is explained here.
A single object can be retrieved either by ID
Artist.find(123)Which can also be a string
Artist.find('thedeadmilkmen')Or a single object is retrieved by taking only the first result of some query
Artist.first()