DS.RESTAdapter#findMany()

findMany (store, type, ids, snapshots) Promise

Inherited from DS.Adapter but overwritten in addon/adapters/rest.js:548

Called by the store in order to fetch several records together if coalesceFindRequests is true

For example, if the original payload looks like:

{
  "id": 1,
  "title": "Rails is omakase",
  "comments": [ 1, 2, 3 ]
}

The IDs will be passed as a URL-encoded Array of IDs, in this form:

ids[]=1&ids[]=2&ids[]=3

Many servers, such as Rails and PHP, will automatically convert this URL-encoded array into an Array for you on the server-side. If you want to encode the IDs, differently, just override this (one-line) method.

The findMany method makes an Ajax (HTTP GET) request to a URL computed by buildURL, and returns a promise for the resulting payload.

Parameters:

store DS.Store
type DS.Model
ids Array
snapshots Array

Returns:

Promise
promise
doc_EmberJs
2016-11-30 16:50:29
Comments
Leave a Comment

Please login to continue.