loopback-datasource-juggler/lib
Partap Davis 29eb3434c7 Promisify model relation methods
When a callback is omitted from a method on a model relation that
supports promises, return that promise.  This includes all the standard
DAO methods, as well as any user-defined methods that return promises.

e.g.:
mylist.todos.create({name: 'Item 1'}) // returns Promise

This API will use native ES6 promises if available.  If not available,
or to force the use of another Promise library, you must assign the
global.Promise object.

e.g.:
global.Promise = require('bluebird')

Relations affected:

- BelongsTo
- HasOne
- HasMany
- HasManyThrough
- HasAndBelongsToMany
- ReferencesMany
- EmbedsOne

Exceptions:

The EmbedsMany relation has not been promisified, because most of the
methods return synchronous values.

The base relation getter method [e.g.: mylist.todos()] has not been
promisified, due to its default caching behavior.

New Methods:

- getAsync(condition, cb)

A new method "getAsync()" has been added to all relations except
EmbedsMany, which always fetches from the datasource rather than from
the cache.  It takes an optional "where" condition (except for HasOne
and BelongsTo) and an optional callback.  If the callback is omitted,
a Promise is returned.
2015-04-07 11:41:07 +02:00
..
connectors Allow nesting properties to be queried for memory connector 2015-03-27 16:05:12 -07:00
browser.depd.js Deprecate Model hooks 2015-02-27 16:58:24 +01:00
dao.js Code cleanup in lib/dao.js 2015-04-01 18:25:04 +02:00
datasource.js fix foreign key dataType bug 2015-03-11 11:30:40 +08:00
geo.js Added support for inline parameters like: new GeoPoint(-34, 150) 2014-12-18 10:47:06 -05:00
hooks.js Deprecate Model hooks 2015-02-27 16:58:24 +01:00
include.js Add support for multiple includes that use relation syntax 2014-11-04 20:45:25 -08:00
introspection.js Tidy up model building from data sources 2014-09-12 14:25:35 -07:00
jutil.js Remove all usages of lodash. 2015-03-26 09:33:48 +01:00
list.js Return 400 when client provides an incorrect value 2015-02-05 16:58:42 +05:30
mixins.js Clean up the mixin processing 2014-08-08 01:20:57 -07:00
model-builder.js Deprecate property names containing a dot 2015-04-02 09:49:04 +02:00
model-definition.js fix id properties should sort by its index 2015-01-21 20:16:34 +08:00
model.js Merge pull request #544 from strongloop/feature/nesting-doc-query 2015-04-02 08:47:10 -07:00
relation-definition.js Promisify model relation methods 2015-04-07 11:41:07 +02:00
relations.js Implemented embedsOne 2014-08-20 08:58:08 -07:00
scope.js Promisify model relation methods 2015-04-07 11:41:07 +02:00
types.js Rewrite the List class for typed array 2014-02-14 10:41:00 -08:00
utils.js ModelBaseClass: promise mode for notifyObserversOf 2015-02-17 18:19:21 +01:00
validations.js Improved and corrected API docs 2015-03-04 17:21:25 -08:00