If you want a set of resources with specific attributes, meta, or computed attributes, you can pass an object as the second argument. Any resource that matches the object will be returned.
In the following example, we return every book that was published in 1970.
Filtering with a function
You can pass a function as a filter as well. The filter will be called with two arguments:
resource: a resource object
resources: all of the resources of the same resource type
Return true from the function to include the resource in the results.
In this example, we return every book that doesn't have a publish year:
Options
getResources accepts a third argument, options. Currently, only option is supported: byId.
Pass true, and you will receive an object back instead of an array, where each key of the object is a resource ID.