Connect Loopback to various Data Sources
Go to file
Miroslav Bajtoš bec9142100 Implement operation hooks for EmbedsMany methods
create() triggers
 - before save
 - after save

updateById() triggers
 - before save
 - after save

destroy() triggers
 - before delete
 - after delete

The implementation here is intentionally left with less features
than the regular DAO methods provide, the goal is to get a partial
(but still useful!) version released soon.

Limitations:

 - `before save` & `after save` hooks don't provide `ctx.isNewInstance`
 - async validations are not supported yet
 - `persist` and `loaded` hooks are not triggered at all

 - `before delete` hook does not provide `ctx.where` property and
    it's not possible to change the outcome of `destroy()` using this
    hook. Note that regular DAO does support this.

 - updating embedded instances triggers update of the parent (owning)
   model, which is correct and expected. However, the context provided
   by `before save` and `after save` hooks on the parent model is sort of
   arbitrary and may include wrong/extra data. The same probably applies
   to the scenario when deleting embedded instances triggers update of
   the parent model.

[back-port of #911]
2016-04-28 10:15:14 +02:00
docs Fix for issue #774 2015-11-24 16:50:41 +05:30
examples eslint config 2.0 + remove extra empty lines 2016-04-19 17:06:04 +02:00
lib Implement operation hooks for EmbedsMany methods 2016-04-28 10:15:14 +02:00
support eslint config 2.0 + remove extra empty lines 2016-04-19 17:06:04 +02:00
test Implement operation hooks for EmbedsMany methods 2016-04-28 10:15:14 +02:00
.editorconfig minor formatting issues (trailing spaces and such) and .editorconfig 2015-02-03 13:08:23 +03:00
.gitignore Add a file option for the memeory connector to persist data 2014-01-29 12:04:09 -08:00
.gitmodules Added Makefile 2011-11-05 17:54:52 +07:00
.jshintignore Add .jshintignore 2013-11-21 19:05:19 +01:00
.npmignore Ignore npm-debug.log 2013-03-30 21:10:20 +04:00
.travis.yml travis: drop 0.6 and 0.8, add iojs 2015-08-24 15:54:49 +02:00
CHANGES.md 2.46.0 2016-04-07 09:12:48 +02:00
CONTRIBUTING.md Fix bad CLA URL in CONTRIBUTING.md 2014-12-29 08:27:46 -08:00
LICENSE Relicense as MIT only 2016-04-06 16:50:02 +02:00
Makefile Add refresh script 2015-11-24 22:46:13 -08:00
NOTICE Add NOTICE 2015-07-18 19:44:46 -07:00
README.md Update README.md 2014-12-01 13:22:24 -08:00
docs.json Enable docs 2015-05-18 09:00:49 -07:00
index.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
package.json 2.46.0 2016-04-07 09:12:48 +02:00

README.md

LoopBack DataSource Juggler

LoopBack DataSource Juggler is an ORM that provides a common set of interfaces for interacting with databases, REST APIs, and other data sources. It was initially forked from JugglingDB.

For full documentation, see the official StrongLoop documentation: Connecting models to data sources

For information on creating data sources programmatically, see Advanced topics: data sources.

Installation

npm install loopback-datasource-juggler

Also install the appropriated connector, for example for mongodb:

npm install loopback-connector-mongodb

See StrongLoop Documentation for more information.