bec9142100
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] |
||
---|---|---|
docs | ||
examples | ||
lib | ||
support | ||
test | ||
.editorconfig | ||
.gitignore | ||
.gitmodules | ||
.jshintignore | ||
.npmignore | ||
.travis.yml | ||
CHANGES.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
Makefile | ||
NOTICE | ||
README.md | ||
docs.json | ||
index.js | ||
package.json |
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.