f1fa976f50
Before this change, when both the PK value (`id`) and the `data` object were provided as plain-data values (e.g. as received in a JSON request), and the connector was using a complex PK type (e.g. `ObjectID` in MongoDB), then `replaceById` operation was printing confusing warnings: WARNING: id property cannot be changed from 5d39775a59f5f541513c5e05 to 5d39775a59f5f541513c5e05 for model:Post in 'before save' operation hook WARNING: id property cannot be changed from 5d39775a59f5f541513c5e05 to 5d39775a59f5f541513c5e05 for model:Post in 'loaded' operation hook This commit fixes the problem by applying the same type coercion on the PK value (`id`) as has been applied by the model constructor on the PK property (`data.id`). Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com> |
||
---|---|---|
.github | ||
docs | ||
examples | ||
intl | ||
lib | ||
support | ||
test | ||
types | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc | ||
.gitignore | ||
.gitmodules | ||
.npmignore | ||
.npmrc | ||
.nycrc | ||
.prettierignore | ||
.prettierrc | ||
.travis.yml | ||
CHANGES.md | ||
CODEOWNERS | ||
CONTRIBUTING.md | ||
LICENSE | ||
NOTICE | ||
README.md | ||
docs.json | ||
index.d.ts | ||
index.js | ||
package.json | ||
tsconfig.json |
README.md
loopback-datasource-juggler
An ORM/ODM that provides a common set of interfaces for interacting with databases, REST APIs, and other types of data sources. It was originally forked from JugglingDB.
Supported versions
This module adopts the Module Long Term Support (LTS) policy, with the following End Of Life (EOL) dates:
Version | Status | Published | EOL |
---|---|---|---|
4.x | Current | Oct 2018 | Apr 2021 (minimum) |
3.x | Active LTS | Dec 2016 | Dec 2020 |
2.x | End-of-Life | Jul 2014 | Apr 2019 |
Learn more about our LTS plan in the LoopBack documentation.
Usage
Install Juggler:
npm install loopback-datasource-juggler
Then install a connector:
npm install loopback-connector-mongodb // in this case, the mongodb connector
Documentation
See the LoopBack documentation.
For information on data source connectors, see Connecting models to data sources.