Class Document

public

A Document is a class that wraps the response content from a request to the API returned by Cache.put or Cache.peek, converting resource-identifiers into record instances.

It is not directly instantiated by the user, and its properties should not be directly modified. Whether individual properties are mutable or not is determined by the record instance itself.

Show:

The primary data for this document, if any.

If this document has no primary data (e.g. because it is an error document) this property will be undefined.

For collections this will be an array of record instances, for single resource requests it will be a single record instance or null.

The errors returned by the API for this request, if any

The identifier associated with this document, if any

The links object for this document, if any

e.g.

{
  self: '/articles?page[number]=3',
}

The meta object for this document, if any