Used to define passthrough relationships - hasOne
, hasMany
,
belongsTo
or belongsToMany
, "through" a Interim
model or collection.
Fetch the models for this collection, resetting the models for the query when they arrive.
Now, load all of the data onto the collection as necessary.
If the "withRelated" is specified, we also need to eager load all of the
data on the collection, as a side-effect, before we ultimately jump into the
next step of the collection. Since the columns
are only relevant to the current
level, ensure those are omitted from the options.
Fetches a single model from the collection, useful on related collections.
Eager loads relationships onto an already populated Collection
instance.
Shortcut for creating a new model, saving, and adding to the collection.
Returns a promise which will resolve with the model added to the collection.
If the model is a relation, put the foreignKey
and fkValue
from the relatedData
hash into the inserted model. Also, if the model is a manyToMany
relation,
automatically create the joining model upon insertion.
If we've already added things on the query chain, these are likely intended for the model.
Reset the query builder, called internally each time a query is run.
Returns an instance of the query builder.
Creates and returns a new Bookshelf.Sync
instance.
Handles the response data for the collection, returning from the collection's fetch call.
Handle the related data loading on the collection.
Collection